From 4d6031f7e4d645db87bc6b89664c05438286e58c Mon Sep 17 00:00:00 2001 From: Ankit Yadav <52023083+4nkitd@users.noreply.github.com> Date: Fri, 3 Feb 2023 15:54:48 +0530 Subject: [PATCH] docs: add Windows setup instructions and update Postman docs (#486) --- .devcontainer/devcontainer.json | 34 + docs/try_local_system.md | 58 +- postman/README.md | 40 +- postman/collection.postman.json | 8358 ------------------------------- 4 files changed, 115 insertions(+), 8375 deletions(-) create mode 100644 .devcontainer/devcontainer.json delete mode 100644 postman/collection.postman.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..80b105ccb9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile +{ + "name": "Existing Dockerfile", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "../Dockerfile" + }, + "features": { + "ghcr.io/devcontainers-contrib/features/redis-homebrew:1": {} + }, + "customizations": { + "vscode": { + "extensions": ["tamasfe.even-better-toml", "rust-lang.rust-analyzer"] + } + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [8080] + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "devcontainer" +} diff --git a/docs/try_local_system.md b/docs/try_local_system.md index 2394eaae78..076e161673 100644 --- a/docs/try_local_system.md +++ b/docs/try_local_system.md @@ -20,6 +20,7 @@ Check the Table Of Contents to jump to the relevant section. - [Set up hyperswitch using Docker Compose](#set-up-hyperswitch-using-docker-compose) - [Set up a Rust environment and other dependencies](#set-up-a-rust-environment-and-other-dependencies) - [Set up dependencies on Ubuntu-based systems](#set-up-dependencies-on-ubuntu-based-systems) + - [Set up dependencies on Windows](#set-up-dependencies-on-windows) - [Set up dependencies on MacOS](#set-up-dependencies-on-macos) - [Set up the database](#set-up-the-database) - [Configure the application](#configure-the-application) @@ -131,12 +132,51 @@ for your distribution and follow along. cargo install diesel_cli --no-default-features --features "postgres" ``` +5. Make sure your system has OpenSSL installed: + + ```shell + sudo apt install libssl-dev + ``` + Once you're done with setting up the dependencies, proceed with [setting up the database](#set-up-the-database). [postgresql-install]: https://www.postgresql.org/download/ [redis-install]: https://redis.io/docs/getting-started/installation/ +### Set up dependencies on Windows + +We'll be using [`winget`][winget] in this section of the guide, where possible. +You can opt to use your favorite package manager instead. + +1. Install PostgreSQL database, following the + [official installation docs][postgresql-install-windows]. + +2. Install Redis, following the + [official installation docs][redis-install-windows]. + +3. Install rust with `winget`: + + ```shell + winget install -e --id Rustlang.Rust.GNU + ``` + +4. Install `diesel_cli` using `cargo`: + + ```shell + cargo install diesel_cli --no-default-features --features "postgres" + ``` + +5. Install OpenSSL with `winget`: + + ```shell + winget install openssl + ``` + +[winget]: https://github.com/microsoft/winget-cli +[postgresql-install-windows]: https://www.postgresql.org/download/windows/ +[redis-install-windows]: https://redis.io/docs/getting-started/installation/install-redis-on-windows + ### Set up dependencies on MacOS We'll be using [Homebrew][homebrew] in this section of the guide. @@ -306,8 +346,13 @@ Once you're done with configuring the application, proceed with 1. Sign up or sign in to [Postman][postman]. 2. Open our [Postman collection][postman-collection] and switch to the ["Variables" tab][variables]. - Add the admin API key you configured in the application configuration under - the "current value" column for the `admin_api_key` variable. + Update the value under the "current value" column for the `baseUrl` variable + to have the hostname and port of the locally running server + (`http://localhost:8080` by default). + +3. While on the "Variables" tab, add the admin API key you configured in the + application configuration under the "current value" column for the + `admin_api_key` variable. 1. If you're running Docker Compose, you can find the configuration file at [`config/docker_compose.toml`][config-docker-compose], search for @@ -316,8 +361,8 @@ Once you're done with configuring the application, proceed with file at [`config/Development.toml`][config-development], search for `admin_api_key` to find the admin API key -3. Open the ["Quick Start" folder][quick-start] in the collection. -4. Open the ["Merchant Account - Create"][merchant-account-create] request, +4. Open the ["Quick Start" folder][quick-start] in the collection. +5. Open the ["Merchant Account - Create"][merchant-account-create] request, switch to the "Body" tab and update any request parameters as required. - If you want to use a different connector for making payments with @@ -330,7 +375,7 @@ Once you're done with configuring the application, proceed with Store the merchant ID, API key and publishable key returned in the response securely. -5. Open the ["Variables" tab][variables] in the +6. Open the ["Variables" tab][variables] in the [Postman collection][postman-collection] and add the following variables: 1. Add the API key you obtained in the previous step under the "current value" @@ -349,6 +394,9 @@ Once you're done with configuring the application, proceed with `connector_account_details` fields and update them. You can find connector-specific details to be included in this [spreadsheet][connector-specific-details]. + - Open the ["Variables" tab][variables] in the + [Postman collection][postman-collection] and set the `connector_api_key` + variable to your connector's API key. Click on the "Send" button to create a payment connector account. You should obtain a response containing most of the data included in the diff --git a/postman/README.md b/postman/README.md index 58c6fa768f..bebdb3aaef 100644 --- a/postman/README.md +++ b/postman/README.md @@ -1,18 +1,34 @@ -## POSTMAN Collection +# Postman Collection -The [Postman](https://www.postman.com/) [collection](./collection.postman.json) is generated using [Portman](https://www.npmjs.com/package/@apideck/portman) tool from the [OpenApi Spec](../openapi/open_api_spec.yaml). +You can find the latest Postman collection [here][postman-collection]. +For getting started quickly, you can also +[fork the Postman collection][postman-collection-fork] under your workspace. -Steps to generate the new collection. +## Auto-Generating the Postman Collection -* Install portman [ [refer to github](https://github.com/apideck-libraries/portman) ] +The [Postman collection][postman-collection] is generated using +[`portman`][portman] tool from the [OpenAPI specification][openapi-spec]. +If you'd like to generate the collection from the OpenAPI specification, you can +follow the below steps: - ```bash - # Global install - $ npm install -g @apideck/portman - ``` +1. Install `portman`, refer to the instructions on + [the repository][portman-repository]: -* From the base directory, run + ```shell + npm install -g @apideck/portman + ``` - ```bash - portman --cliOptionsFile postman/portman-cli.json - ``` \ No newline at end of file +2. From the root of the project directory, run the following command to generate + the Postman collection. + + ```shell + portman --cliOptionsFile postman/portman-cli.json + ``` + +**NOTE:** Please verify Postman collection variables before trying out the APIs. + +[postman-collection]: https://www.postman.com/hyperswitch/workspace/hyperswitch/collection/25176183-e36f8e3d-078c-4067-a273-f456b6b724ed +[postman-collection-fork]: https://www.postman.com/hyperswitch/workspace/hyperswitch/collection/25176183-e36f8e3d-078c-4067-a273-f456b6b724ed/fork +[portman]: https://www.npmjs.com/package/@apideck/portman +[openapi-spec]: /openapi/open_api_spec.yaml +[portman-repository]: https://github.com/apideck-libraries/portman diff --git a/postman/collection.postman.json b/postman/collection.postman.json deleted file mode 100644 index 2c5c2f1fd8..0000000000 --- a/postman/collection.postman.json +++ /dev/null @@ -1,8358 +0,0 @@ -{ - "_": { - "postman_id": "3dc82900-7204-449f-84e4-166e61c8258c" - }, - "item": [ - { - "id": "903acd79-97a7-4a19-b496-4d037c1f3b24", - "name": "QuickStart", - "description": { - "content": "Quickly get started with our API suite.", - "type": "text/plain" - }, - "item": [ - { - "id": "ada83310-b76a-4544-846b-6683f444b3d4", - "name": "Merchant Account - Create", - "request": { - "name": "Merchant Account - Create", - "description": { - "content": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments.", - "type": "text/plain" - }, - "url": { - "path": [ - "accounts" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"merchant_id\": \"y3oqhf46pyzuxjbcn2giaqnb44\",\n \"merchant_name\": \"NewAge Retailer\",\n \"merchant_details\": {\n \"primary_contact_person\": \"John Test\",\n \"primary_email\": \"JohnTest@test.com\",\n \"primary_phone\": \"occaecat officia\",\n \"secondary_contact_person\": \"John Test2\",\n \"secondary_email\": \"JohnTest2@test.com\",\n \"secondary_phone\": \"Duis eiusmod officia nisi\",\n \"website\": \"www.example.com\",\n \"about_business\": \"Online Retail with a wide selection of organic products for North America\",\n \"address\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n }\n },\n \"return_url\": \"www.example.com/success\",\n \"webhook_details\": {\n \"webhook_version\": \"1.0.1\",\n \"webhook_username\": \"ekart_retail\",\n \"webhook_password\": \"password_ekart@123\",\n \"payment_created_enabled\": true,\n \"payment_succeeded_enabled\": true,\n \"payment_failed_enabled\": true\n },\n \"routing_algorithm\": \"custom\",\n \"custom_routing_rules\": [\n {\n \"payment_methods_incl\": [\n \"card\",\n \"card\"\n ],\n \"payment_methods_excl\": [\n \"card\",\n \"card\"\n ],\n \"payment_method_types_incl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_types_excl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_issuers_incl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"payment_method_issuers_excl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"countries_incl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"countries_excl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"currencies_incl\": [\n \"USD\",\n \"EUR\"\n ],\n \"currencies_excl\": [\n \"AED\",\n \"SGD\"\n ],\n \"metadata_filters_keys\": [\n \"payments.udf1\",\n \"payments.udf2\"\n ],\n \"metadata_filters_values\": [\n \"android\",\n \"Category_Electronics\"\n ],\n \"connectors_pecking_order\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_key\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_value\": [\n 50,\n 30,\n 20\n ]\n },\n {\n \"payment_methods_incl\": [\n \"card\",\n \"card\"\n ],\n \"payment_methods_excl\": [\n \"card\",\n \"card\"\n ],\n \"payment_method_types_incl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_types_excl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_issuers_incl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"payment_method_issuers_excl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"countries_incl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"countries_excl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"currencies_incl\": [\n \"USD\",\n \"EUR\"\n ],\n \"currencies_excl\": [\n \"AED\",\n \"SGD\"\n ],\n \"metadata_filters_keys\": [\n \"payments.udf1\",\n \"payments.udf2\"\n ],\n \"metadata_filters_values\": [\n \"android\",\n \"Category_Electronics\"\n ],\n \"connectors_pecking_order\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_key\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_value\": [\n 50,\n 30,\n 20\n ]\n }\n ],\n \"sub_merchants_enabled\": false,\n \"parent_merchant_id\": \"xkkdf909012sdjki2dkh5sdf\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "2c3a38ba-0666-491a-8835-0e8a52f29f41", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/accounts - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/accounts - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Merchant Account\",\"required\":[\"merchant_id\"],\"properties\":{\"merchant_id\":{\"type\":\"string\",\"description\":\"The identifier for the Merchant Account.\",\"maxLength\":255,\"example\":\"y3oqhf46pyzuxjbcn2giaqnb44\"},\"api_key\":{\"type\":\"string\",\"description\":\"The public security key for accessing the APIs\",\"maxLength\":255,\"example\":\"xkkdf909012sdjki2dkh5sdf\"},\"merchant_name\":{\"type\":\"string\",\"description\":\"Name of the merchant\",\"example\":\"NewAge Retailer\"},\"merchant_details\":{\"type\":\"object\",\"description\":\"Details about the merchant including contact person, email, address, website, business description etc\",\"properties\":{\"primary_contact_person\":{\"type\":\"string\",\"description\":\"The merchant's primary contact name\",\"maxLength\":255,\"example\":\"John Test\"},\"primary_email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The merchant's primary email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"primary_phone\":{\"type\":\"string\",\"description\":\"The merchant's primary phone number\",\"maxLength\":255,\"example\":9999999999},\"secondary_contact_person\":{\"type\":\"string\",\"description\":\"The merchant's secondary contact name\",\"maxLength\":255,\"example\":\"John Test2\"},\"secondary_email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The merchant's secondary email address\",\"maxLength\":255,\"example\":\"JohnTest2@test.com\"},\"secondary_phone\":{\"type\":\"string\",\"description\":\"The merchant's secondary phone number\",\"maxLength\":255,\"example\":9999999998},\"website\":{\"type\":\"string\",\"description\":\"The business website of the merchant\",\"maxLength\":255,\"example\":\"www.example.com\"},\"about_business\":{\"type\":\"string\",\"description\":\"A brief description about merchant's business\",\"maxLength\":255,\"example\":\"Online Retail with a wide selection of organic products for North America\"},\"address\":{\"type\":\"object\",\"description\":\"The address for the merchant\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}}}},\"webhook_details\":{\"type\":\"object\",\"description\":\"The features for Webhook\",\"properties\":{\"webhook_version\":{\"type\":\"string\",\"description\":\"The version for Webhook\",\"maxLength\":255,\"example\":\"1.0.1\"},\"webhook_username\":{\"type\":\"string\",\"description\":\"The user name for Webhook login\",\"maxLength\":255,\"example\":\"ekart_retail\"},\"webhook_password\":{\"type\":\"string\",\"description\":\"The password for Webhook login\",\"maxLength\":255,\"example\":\"password_ekart@123\"},\"payment_created_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a new payment is created\",\"example\":true},\"payment_succeeded_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a payment is successful\",\"example\":true},\"payment_failed_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a payment fails\",\"example\":true}}},\"routing_algorithm\":{\"type\":\"string\",\"description\":\"The routing algorithm to be used to process the incoming request from merchant to outgoing payment processor or payment method. The default is CUSTOM if\",\"enum\":[\"round_robin\",\"max_conversion\",\"min_cost\",\"custom\"],\"maxLength\":255,\"example\":\"custom\"},\"custom_routing_rules\":{\"type\":\"array\",\"description\":\"An array of custom routing rules\",\"items\":{\"properties\":{\"payment_methods_incl\":{\"type\":\"array\",\"description\":\"The List of payment methods to include for this routing rule\",\"items\":{\"type\":\"string\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"],\"example\":\"card\"},\"example\":[\"card\",\"upi\"]},\"payment_methods_excl\":{\"type\":\"array\",\"description\":\"The List of payment methods to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"],\"example\":\"card\"},\"example\":[\"card\",\"upi\"]},\"payment_method_types_incl\":{\"type\":\"array\",\"description\":\"The List of payment method types to include for this routing rule\",\"items\":{\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"],\"example\":\"credit_card\"},\"example\":[\"credit_card\",\"debit_card\"]},\"payment_method_types_excl\":{\"type\":\"array\",\"description\":\"The List of payment method types to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"],\"example\":\"credit_card\"},\"example\":[\"credit_card\",\"debit_card\"]},\"payment_method_issuers_incl\":{\"type\":\"array\",\"description\":\"The List of payment method issuers to include for this routing rule\",\"items\":{\"type\":\"string\"},\"example\":[\"Citibank\",\"JPMorgan\"]},\"payment_method_issuers_excl\":{\"type\":\"array\",\"description\":\"The List of payment method issuers to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\"},\"example\":[\"Citibank\",\"JPMorgan\"]},\"countries_incl\":{\"type\":\"array\",\"description\":\"The List of countries to include for this routing rule\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2,\"example\":\"US\"},\"example\":[\"US\",\"UK\",\"IN\"]},\"countries_excl\":{\"type\":\"array\",\"description\":\"The List of countries to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2,\"example\":\"US\"},\"example\":[\"US\",\"UK\",\"IN\"]},\"currencies_incl\":{\"type\":\"array\",\"description\":\"The List of currencies to include for this routing rule\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3,\"example\":\"USD\"},\"example\":[\"USD\",\"EUR\"]},\"currencies_excl\":{\"type\":\"array\",\"description\":\"The List of currencies to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3,\"example\":\"USD\"},\"example\":[\"AED\",\"SGD\"]},\"metadata_filters_keys\":{\"type\":\"array\",\"description\":\"List of Metadata Filters to apply for the Routing Rule. The filters are presented as 2 arrays of keys and value. This property contains all the keys.\",\"items\":{\"type\":\"string\"},\"example\":[\"payments.udf1\",\"payments.udf2\"]},\"metadata_filters_values\":{\"type\":\"array\",\"description\":\"List of Metadata Filters to apply for the Routing Rule. The filters are presented as 2 arrays of keys and value. This property contains all the keys.\",\"items\":{\"type\":\"string\"},\"example\":[\"android\",\"Category_Electronics\"]},\"connectors_pecking_order\":{\"type\":\"array\",\"description\":\"The pecking order of payment connectors (or processors) to be used for routing. The first connector in the array will be attempted for routing. If it fails, the second connector will be used till the list is exhausted.\",\"items\":{\"type\":\"string\",\"description\":\"Unique name used for identifying the Connector\",\"enum\":[\"stripe\",\"adyen\",\"brain_tree\",\"dlocal\",\"cyber_source\"],\"example\":\"stripe\"},\"example\":[\"stripe\",\"adyen\",\"brain_tree\"]},\"connectors_traffic_weightage_key\":{\"type\":\"array\",\"description\":\"An Array of Connectors (as Keys) with the associated percentage of traffic to be routed through the given connector (Expressed as an array of values)\",\"items\":{\"type\":\"string\",\"description\":\"Unique name used for identifying the Connector\",\"enum\":[\"stripe\",\"adyen\",\"brain_tree\",\"dlocal\",\"cyber_source\"],\"example\":\"stripe\"},\"example\":[\"stripe\",\"adyen\",\"brain_tree\"]},\"connectors_traffic_weightage_value\":{\"type\":\"array\",\"description\":\"An Array of Weightage (expressed in percentage) that needs to be associated with the respective connectors (Expressed as an array of keys)\",\"items\":{\"type\":\"integer\",\"minimum\":0,\"maximum\":100,\"example\":50},\"example\":[50,30,20]}},\"example\":[{\"payment_method_types_incl\":[\"credit_card\"],\"connectors_pecking_order\":[\"stripe\",\"adyen\",\"brain_tree\"]},{\"payment_method_types_incl\":[\"debit_card\"],\"connectors_traffic_weightage_key\":[\"stripe\",\"adyen\",\"brain_tree\"],\"connectors_traffic_weightage_value\":[50,30,20]}],\"type\":\"object\"}},\"sub_merchants_enabled\":{\"type\":\"boolean\",\"description\":\"A boolean value to indicate if the merchant is a sub-merchant under a master or a parent merchant. By default, its value is false.\",\"maxLength\":255,\"example\":false},\"parent_merchant_id\":{\"type\":\"string\",\"description\":\"Refers to the Parent Merchant ID if the merchant being created is a sub-merchant\",\"maxLength\":255,\"example\":\"xkkdf909012sdjki2dkh5sdf\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/accounts - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "15ecb077-377f-4894-8495-6eefe89b5d58", - "name": "Payment Connector - Create", - "request": { - "name": "Payment Connector - Create", - "description": { - "content": "Create a new Payment Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc.", - "type": "text/plain" - }, - "url": { - "path": [ - "account", - ":account_id", - "connectors" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the merchant account", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "account_id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"merchant_id\": \"y3oqhf46pyzuxjbcn2giaqnb44\",\n \"connector_type\": \"fiz_operations\",\n \"connector_name\": \"stripe\",\n \"connector_account_details\": {\n \"api_key\": \"Basic MyVerySecretApiKey\"\n },\n \"test_mode\": false,\n \"disabled\": false,\n \"payment_methods_enabled\": [\n {\n \"payment_method\": \"card\",\n \"payment_method_types\": [\n \"debit_card\",\n \"debit_card\"\n ],\n \"payment_method_issuers\": [\n \"aute anim ipsum\",\n \"dolor ullamco Excepteur consectetur\"\n ],\n \"payment_schemes\": [\n \"Discover\",\n \"VISA\"\n ],\n \"accepted_currencies\": [\n \"sin\",\n \"nos\"\n ],\n \"accepted_countries\": [\n \"cu\",\n \"cu\"\n ],\n \"minimum_amount\": 1,\n \"maximum_amount\": -29190167,\n \"recurring_enabled\": true,\n \"installment_payment_enabled\": true,\n \"payment_experience\": [\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n },\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n }\n ]\n },\n {\n \"payment_method\": \"card\",\n \"payment_method_types\": [\n \"upi_intent\",\n \"debit_card\"\n ],\n \"payment_method_issuers\": [\n \"incididunt qui commodo\",\n \"eu\"\n ],\n \"payment_schemes\": [\n \"MasterCard\",\n \"Discover\"\n ],\n \"accepted_currencies\": [\n \"sin\",\n \"Dui\"\n ],\n \"accepted_countries\": [\n \"ir\",\n \"do\"\n ],\n \"minimum_amount\": 1,\n \"maximum_amount\": -63572359,\n \"recurring_enabled\": true,\n \"installment_payment_enabled\": true,\n \"payment_experience\": [\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n },\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "bae7c867-3645-477f-98e9-bf21629c5370", - "name": "Payments - Create", - "request": { - "name": "Payments - Create", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "4361f6ec-9431-419e-ad10-11eb4d8b5647", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payments - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resPaymentId = jsonData?.payment_id;\n", - "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id\nif (_resPaymentId !== undefined) {\n pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);\n console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);\n} else {\n console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');\n};\n", - "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", - "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id\nif (_resMandateId !== undefined) {\n pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);\n console.log(\"- use {{mandate_id}} as collection variable for value\",jsonData.mandate_id);\n} else {\n console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');\n};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "b8845102-fc7a-4821-92b9-6428b0625ea3", - "name": "Payments - Retrieve", - "request": { - "name": "Payments - Retrieve", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "6a807bd1-b3c4-46e8-afec-ea3c200ce01a", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - }, - { - "id": "87725fd9-aa72-4287-83d0-16c6944e19f2", - "name": "Refunds - Create", - "request": { - "name": "Refunds - Create", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\",\n \"amount\": 100,\n \"currency\": \"USD\",\n \"reason\": \"Customer returned product\",\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "00d9ff2d-7a87-4041-bb59-8e70b6323798", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/refunds - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "2d4b82d5-cb64-4a2b-be17-8a9164c7b4f1", - "name": "Refunds - Retrieve", - "request": { - "name": "Refunds - Retrieve", - "description": { - "content": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique refund id", - "type": "text/plain" - }, - "type": "string", - "value": "{{refund_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "a62efe81-3905-4426-b327-db44a2948447", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/refunds/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/refunds/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - } - ], - "event": [] - }, - { - "id": "cf872cb1-583e-4b5b-9700-70ea3d749ad3", - "name": "Payments", - "description": { - "content": "Process and manage payments across wide range of payment processors using the Unified Payments API.", - "type": "text/plain" - }, - "item": [ - { - "id": "a5732695-2ef3-48a1-b507-d114673f46b7", - "name": "Payments - Create", - "request": { - "name": "Payments - Create", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "3019fe1f-863d-4bbe-8701-94905d019676", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payments - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resPaymentId = jsonData?.payment_id;\n", - "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id\nif (_resPaymentId !== undefined) {\n pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);\n console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);\n} else {\n console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');\n};\n", - "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", - "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id\nif (_resMandateId !== undefined) {\n pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);\n console.log(\"- use {{mandate_id}} as collection variable for value\",jsonData.mandate_id);\n} else {\n console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');\n};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "11a3569f-6048-4bea-b1a8-3933b908297c", - "name": "Payments - Update", - "request": { - "name": "Payments - Update", - "description": { - "content": "To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created ", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2022-09-10T10:11:12Z\",\n \"amount_to_capture\": 6540,\n \"amount_capturable\": 6540,\n \"customer_id\": \"cus_udst2tfldj6upmye2reztkmm4i\",\n \"email\": \"guest@example.com\",\n \"name\": \"John Doe\",\n \"phone\": \"999999999\",\n \"phone_country_code\": \"+65\",\n \"description\": \"Its my first payment request\",\n \"setup_future_usage\": \"optional\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"save_payment_method\": true,\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"35\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\"\n }\n },\n \"statement_descriptor_name\": \"Juspay\",\n \"statement_descriptor_suffix\": \"Router\",\n \"shipping\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"billing\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "357989fd-cef8-4917-87f7-2f8f75c42997", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payments/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "9226badf-e978-483e-a160-b9437d2a179f", - "name": "Payments - Retrieve", - "request": { - "name": "Payments - Retrieve", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "c7b5eb4d-fc3f-4197-b890-260f34c00f48", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - }, - { - "id": "2b34535f-e87c-4dce-848e-0cec31f595f5", - "name": "Payments - Capture", - "request": { - "name": "Payments - Capture", - "description": { - "content": "To capture the funds for an uncaptured payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id", - "capture" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount_to_capture\": 6540,\n \"statement_descriptor_name\": \"Juspay\",\n \"statement_descriptor_suffix\": \"Router\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "ea261753-34dc-4e67-8929-9170b40e79d2", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/capture - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/capture - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/capture - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/capture - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "0ebd726d-818f-4cef-b6ef-9b716bac80eb", - "name": "Payments - Confirm", - "request": { - "name": "Payments - Confirm", - "description": { - "content": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id", - "confirm" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"return_url\": \"http://example.com/payments\",\n \"setup_future_usage\": \"optional\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"save_payment_method\": true,\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"35\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\"\n }\n },\n \"shipping\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"billing\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "f65d5315-fba1-4449-a995-7c0819eaf741", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/confirm - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/confirm - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "1815cdb1-1300-4350-8af8-d40239066125", - "name": "Payments - Cancel", - "request": { - "name": "Payments - Cancel", - "description": { - "content": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id", - "cancel" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"cancellation_reason\": \"Payment attempt expired\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "e0000bb1-9e97-4c7a-ac88-b41a07f05c1e", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/cancel - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/cancel - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/cancel - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/cancel - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/cancel - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/cancel - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - } - ], - "event": [] - }, - { - "id": "e038723a-0114-48e7-8122-ae86d3878880", - "name": "Customers", - "description": { - "content": "Create a Customer entity which you can use to store and retrieve specific customers' data and payment methods.", - "type": "text/plain" - }, - "item": [ - { - "id": "ab164211-e7ed-4b2f-925d-3419a075860c", - "name": "Create Customer", - "request": { - "name": "Create Customer", - "description": { - "content": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"customer_id\": \"cus_udst2tfldj6upmye2reztkmm4i\",\n \"email\": \"guest@example.com\",\n \"name\": \"John Doe\",\n \"phone\": \"999999999\",\n \"phone_country_code\": \"+65\",\n \"description\": \"First customer\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "d99cc433-a650-44d6-a919-d18a53774cbd", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/customers - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/customers - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/customers - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/customers - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resCustomerId = jsonData?.customer_id;\n", - "// Response body should have \"customer_id\"\npm.test(\"[POST]::/customers - Content check if 'customer_id' exists\", function() {\n pm.expect(_resCustomerId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"1\" for \"customer_id\"\nif (_resCustomerId !== undefined) {\npm.test(\"[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'\", function() {\n pm.expect(jsonData.customer_id.length).is.at.least(1);\n})};\n", - "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id\nif (_resCustomerId !== undefined) {\n pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);\n console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);\n} else {\n console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');\n};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "7db3370f-200a-4c43-9474-5b5eee4d3557", - "name": "Retrieve Customer", - "request": { - "name": "Retrieve Customer", - "description": { - "content": "Retrieve a customer's details.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "9f5864f6-2e54-430f-bcbd-3386a10fa300", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/customers/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/customers/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - }, - { - "id": "30d2581e-fcca-4e74-8121-29110874c204", - "name": "Update Customer", - "request": { - "name": "Update Customer", - "description": { - "content": "Updates the customer's details in a customer object.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone_country_code\": \"+65\",\n \"phone\": \"anim sed amet\",\n \"address\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"description\": \"First customer\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "05ac5ab2-a1bd-4767-9558-a759f14d708c", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/customers/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/customers/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "11db16b1-5edb-4991-8481-0c25880cae65", - "name": "Delete Customer", - "request": { - "name": "Delete Customer", - "description": { - "content": "Delete a customer record.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "DELETE" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "c851b4ee-eebc-48cf-8d41-0a84181e1890", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[DELETE]::/customers/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[DELETE]::/customers/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[DELETE]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\",\"deleted\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"deleted\":{\"type\":\"boolean\",\"description\":\"Indicates the deletion status of the customer object.\",\"example\":true}}}\n\n// Validate if response matches JSON schema \npm.test(\"[DELETE]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - } - ], - "event": [] - }, - { - "id": "1f5df9eb-29f4-4c01-bf57-b983a8f59256", - "name": "PaymentMethods", - "description": { - "content": "", - "type": "text/plain" - }, - "item": [ - { - "id": "e931c687-717c-432e-b211-99108e527e1c", - "name": "List payment methods for a Customer", - "request": { - "name": "List payment methods for a Customer", - "description": { - "content": "To filter and list the applicable payment methods for a particular Customer ID", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":customer_id", - "payment_methods" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [ - { - "disabled": false, - "key": "accepted_country", - "value": "ex" - }, - { - "disabled": false, - "key": "accepted_country", - "value": "an" - }, - { - "disabled": false, - "key": "accepted_currency", - "value": "pariatur id ullamco ad magna" - }, - { - "disabled": false, - "key": "accepted_currency", - "value": "commodo magna" - }, - { - "disabled": false, - "key": "minimum_amount", - "value": "100" - }, - { - "disabled": false, - "key": "maximum_amount", - "value": "10000000" - }, - { - "disabled": false, - "key": "recurring_payment_enabled", - "value": "true" - }, - { - "disabled": false, - "key": "installment_payment_enabled", - "value": "true" - } - ], - "variable": [] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET", - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "52e56c70-31f7-47c1-884c-a15f25cfb2b5", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/customers/:customer_id/payment_methods - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/customers/:customer_id/payment_methods - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/customers/:customer_id/payment_methods - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"enabled_payment_methods\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"description\":\"Details of all the payment methods enabled for the connector for the given merchant account\",\"items\":{\"properties\":{\"payment_method\":{\"type\":\"string\",\"example\":\"card\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"]},\"payment_method_types\":{\"type\":\"array\",\"items\":{\"example\":[\"CREDIT\"],\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"]}},\"payment_method_issuers\":{\"type\":\"array\",\"description\":\"List of payment method issuers to be enabled for this payment method\",\"items\":{\"type\":\"string\",\"example\":[\"HDFC\"]}},\"payment_schemes\":{\"type\":\"array\",\"description\":\"List of payment schemes accepted or has the processing capabilities of the processor\",\"items\":{\"example\":[\"MASTER\",\"VISA\",\"DINERS\"],\"type\":\"string\",\"description\":\"Represent the payment schemes and networks\",\"enum\":[\"VISA\",\"MasterCard\",\"Discover\",\"AMEX\"]}},\"accepted_currencies\":{\"type\":\"array\",\"description\":\"List of currencies accepted or has the processing capabilities of the processor\",\"items\":{\"example\":[\"USD\",\"EUR\",\"AED\"],\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3}},\"accepted_countries\":{\"type\":\"array\",\"description\":\"List of Countries accepted or has the processing capabilities of the processor\",\"items\":{\"example\":[\"US\",\"IN\"],\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2}},\"minimum_amount\":{\"type\":\"integer\",\"description\":\"Minimum amount supported by the processor. To be represented in the lowest denomination of the target currency (For example, for USD it should be in cents)\",\"example\":1},\"maximum_amount\":{\"type\":\"integer\",\"description\":\"Maximum amount supported by the processor. To be represented in the lowest denomination of the target currency (For example, for USD it should be in cents)\",\"example\":null},\"recurring_enabled\":{\"type\":\"boolean\",\"description\":\"Boolean to enable recurring payments / mandates. Default is true.\",\"example\":true},\"installment_payment_enabled\":{\"type\":\"boolean\",\"description\":\"Boolean to enable installment / EMI / BNPL payments. Default is true.\",\"example\":true},\"payment_experience\":{\"type\":\"array\",\"description\":\"Type of payment experience enabled with the connector\",\"items\":{\"type\":\"object\",\"description\":\"States the next action to complete the payment\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"example\":[\"redirect_to_url\"]}},\"type\":\"object\"}}},\"customer_payment_methods\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"description\":\"Refers to the Parent Merchant ID if the merchant being created is a sub-merchant\",\"required\":[\"payment_method_id\",\"payment_method\",\"recurring_enabled\",\"installment_enabled\",\"payment_experience\"],\"properties\":{\"payment_method_id\":{\"type\":\"string\",\"description\":\"The identifier for the payment method object.\",\"maxLength\":30,\"example\":\"pm_y3oqhf46pyzuxjbcn2giaqnb44\"},\"payment_method\":{\"type\":\"string\",\"description\":\"The type of payment method use for the payment.\\n\",\"enum\":[\"card\",\"payment_container\",\"bank_transfer\",\"bank_debit\",\"pay_later\",\"upi\",\"netbanking\"],\"example\":\"card\"},\"payment_method_type\":{\"type\":\"string\",\"description\":\"This is a sub-category of payment method.\\n\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\",\"credit_card_installments\",\"pay_later_installments\"],\"example\":\"credit_card\"},\"payment_method_issuer\":{\"type\":\"string\",\"description\":\"The name of the bank/ provider issuing the payment method to the end user\\n\",\"example\":\"Citibank\"},\"payment_method_issuer_code\":{\"type\":\"string\",\"description\":\"A standard code representing the issuer of payment method\\n\",\"example\":\"PM_APPLEPAY\"},\"card\":{\"type\":\"object\",\"description\":\"Card Payment Method object\",\"properties\":{\"last4_digits\":{\"type\":\"string\",\"description\":\"The last four digits of the case which could be displayed to the end user for identification.\",\"example\":\"xxxxxxxxxxxx4242\"},\"card_exp_month\":{\"type\":\"string\",\"description\":\"The expiry month for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"10\"},\"card_exp_year\":{\"type\":\"string\",\"description\":\"Expiry year for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"25\"},\"card_holder_name\":{\"type\":\"string\",\"description\":\"The name of card holder\",\"maxLength\":255,\"example\":\"John Doe\"},\"card_token\":{\"type\":\"string\",\"description\":\"The token provided against a user's saved card. The token would be valid for 15 minutes.\",\"minLength\":30,\"maxLength\":30,\"example\":\"tkn_78892490hfh3r834rd\"},\"scheme\":{\"type\":\"string\",\"description\":\"The card scheme network for the particular card\",\"example\":\"MASTER\"},\"issuer_country\":{\"type\":\"string\",\"description\":\"The country code in in which the card was issued\",\"minLength\":2,\"maxLength\":2,\"example\":\"US\"},\"card_fingerprint\":{\"type\":\"string\",\"description\":\"A unique identifier alias to identify a particular card.\",\"minLength\":30,\"maxLength\":30,\"example\":\"fpt_78892490hfh3r834rd\"}}},\"payment_scheme\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The network scheme to which the payment method belongs\\n\",\"example\":[\"MASTER\",\"VISA\"]}},\"accepted_country\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\\n\",\"example\":[\"US\",\"UK\",\"IN\"],\"maxLength\":2,\"minLength\":2}},\"accepted_currency\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":[\"USD\",\"EUR\"]}},\"minimum_amount\":{\"type\":\"integer\",\"description\":\"The minimum amount accepted for processing by the particular payment method.\\n\",\"example\":100},\"maximum_amount\":{\"type\":\"integer\",\"description\":\"The minimum amount accepted for processing by the particular payment method.\\n\",\"example\":10000000},\"recurring_payment_enabled\":{\"type\":\"boolean\",\"description\":\"Indicates whether the payment method is eligible for recurring payments\",\"example\":true},\"installment_payment_enabled\":{\"type\":\"boolean\",\"description\":\"Indicates whether the payment method is eligible for installment payments\",\"example\":true},\"payment_experience\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"This indicates type of action that is required in order to complete the payment with inputs from the user. This may involve actions such as redirecting the user to a URL, displaying a QR code, invoking the SDK client\",\"enum\":[\"redirect_to_url\",\"display_qr_code\",\"invoke_sdk_client\"],\"example\":[\"redirect_to_url\",\"display_qr_code\"]}}}}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/customers/:customer_id/payment_methods - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - }, - { - "id": "ab312690-fcf0-4710-94a4-ff230daf1a05", - "name": "PaymentMethods - Create", - "request": { - "name": "PaymentMethods - Create", - "description": { - "content": "To create a payment method against a customer object. In case of cards, this API could be used only by PCI compliant merchants", - "type": "text/plain" - }, - "url": { - "path": [ - "payment_methods" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_method\": \"card\",\n \"payment_method_type\": \"credit_card\",\n \"payment_method_issuer\": \"Citibank\",\n \"payment_method_issuer_code\": \"JP_APPLEPAY\",\n \"card\": {\n \"card_number\": \"nisi qui occaecat nonlabore ad\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\"\n },\n \"customer_id\": \"cus_mnewerunwiuwiwqw\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "d24c27e4-4154-46c7-8e1b-b57fab0ffeb0", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payment_methods - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payment_methods - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_method_id\",\"payment_method\",\"recurring_enabled\",\"installment_enabled\",\"payment_experience\"],\"properties\":{\"payment_method_id\":{\"type\":\"string\",\"description\":\"The identifier for the payment method object.\",\"maxLength\":30,\"example\":\"pm_y3oqhf46pyzuxjbcn2giaqnb44\"},\"payment_method\":{\"type\":\"string\",\"description\":\"The type of payment method use for the payment.\\n\",\"enum\":[\"card\",\"payment_container\",\"bank_transfer\",\"bank_debit\",\"pay_later\",\"upi\",\"netbanking\"],\"example\":\"card\"},\"payment_method_type\":{\"type\":\"string\",\"description\":\"This is a sub-category of payment method.\\n\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\",\"credit_card_installments\",\"pay_later_installments\"],\"example\":\"credit_card\"},\"payment_method_issuer\":{\"type\":\"string\",\"description\":\"The name of the bank/ provider issuing the payment method to the end user\\n\",\"example\":\"Citibank\"},\"payment_method_issuer_code\":{\"type\":\"string\",\"description\":\"A standard code representing the issuer of payment method\\n\",\"example\":\"PM_APPLEPAY\"},\"card\":{\"type\":\"object\",\"description\":\"Card Payment Method object\",\"properties\":{\"last4_digits\":{\"type\":\"string\",\"description\":\"The last four digits of the case which could be displayed to the end user for identification.\",\"example\":\"xxxxxxxxxxxx4242\"},\"card_exp_month\":{\"type\":\"string\",\"description\":\"The expiry month for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"10\"},\"card_exp_year\":{\"type\":\"string\",\"description\":\"Expiry year for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"25\"},\"card_holder_name\":{\"type\":\"string\",\"description\":\"The name of card holder\",\"maxLength\":255,\"example\":\"John Doe\"},\"card_token\":{\"type\":\"string\",\"description\":\"The token provided against a user's saved card. The token would be valid for 15 minutes.\",\"minLength\":30,\"maxLength\":30,\"example\":\"tkn_78892490hfh3r834rd\"},\"scheme\":{\"type\":\"string\",\"description\":\"The card scheme network for the particular card\",\"example\":\"MASTER\"},\"issuer_country\":{\"type\":\"string\",\"description\":\"The country code in in which the card was issued\",\"minLength\":2,\"maxLength\":2,\"example\":\"US\"},\"card_fingerprint\":{\"type\":\"string\",\"description\":\"A unique identifier alias to identify a particular card.\",\"minLength\":30,\"maxLength\":30,\"example\":\"fpt_78892490hfh3r834rd\"}}},\"payment_scheme\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The network scheme to which the payment method belongs\\n\",\"example\":[\"MASTER\",\"VISA\"]}},\"accepted_country\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\\n\",\"example\":[\"US\",\"UK\",\"IN\"],\"maxLength\":2,\"minLength\":2}},\"accepted_currency\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":[\"USD\",\"EUR\"]}},\"minimum_amount\":{\"type\":\"integer\",\"description\":\"The minimum amount accepted for processing by the particular payment method.\\n\",\"example\":100},\"maximum_amount\":{\"type\":\"integer\",\"description\":\"The minimum amount accepted for processing by the particular payment method.\\n\",\"example\":10000000},\"recurring_payment_enabled\":{\"type\":\"boolean\",\"description\":\"Indicates whether the payment method is eligible for recurring payments\",\"example\":true},\"installment_payment_enabled\":{\"type\":\"boolean\",\"description\":\"Indicates whether the payment method is eligible for installment payments\",\"example\":true},\"payment_experience\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"This indicates type of action that is required in order to complete the payment with inputs from the user. This may involve actions such as redirecting the user to a URL, displaying a QR code, invoking the SDK client\",\"enum\":[\"redirect_to_url\",\"display_qr_code\",\"invoke_sdk_client\"],\"example\":[\"redirect_to_url\",\"display_qr_code\"]}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payment_methods - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resPaymentMethodId = jsonData?.payment_method_id;\n", - "// pm.collectionVariables - Set payment_method_id as variable for jsonData.payment_method_id\nif (_resPaymentMethodId !== undefined) {\n pm.collectionVariables.set(\"payment_method_id\", jsonData.payment_method_id);\n console.log(\"- use {{payment_method_id}} as collection variable for value\",jsonData.payment_method_id);\n} else {\n console.log('INFO - Unable to assign variable {{payment_method_id}}, as jsonData.payment_method_id is undefined.');\n};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "a403ea79-c7ea-484f-9126-3e0a67d1a576", - "name": "PaymentMethods - Update", - "request": { - "name": "PaymentMethods - Update", - "description": { - "content": "To update an existing a payment method attached to a customer object. This API is useful for use cases such as updating the card number for expired cards, to prevent discontinuity in recurring payments", - "type": "text/plain" - }, - "url": { - "path": [ - "payment_methods", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the payment method", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_method_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"card\": {\n \"card_number\": \"aliquacillum incididunt non id\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\"\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "7a498acd-b98b-49c7-ba4d-b5aabf75ba37", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payment_methods/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payment_methods/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_method_id\",\"payment_method\",\"recurring_enabled\",\"installment_enabled\",\"payment_experience\"],\"properties\":{\"payment_method_id\":{\"type\":\"string\",\"description\":\"The identifier for the payment method object.\",\"maxLength\":30,\"example\":\"pm_y3oqhf46pyzuxjbcn2giaqnb44\"},\"payment_method\":{\"type\":\"string\",\"description\":\"The type of payment method use for the payment.\\n\",\"enum\":[\"card\",\"payment_container\",\"bank_transfer\",\"bank_debit\",\"pay_later\",\"upi\",\"netbanking\"],\"example\":\"card\"},\"payment_method_type\":{\"type\":\"string\",\"description\":\"This is a sub-category of payment method.\\n\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\",\"credit_card_installments\",\"pay_later_installments\"],\"example\":\"credit_card\"},\"payment_method_issuer\":{\"type\":\"string\",\"description\":\"The name of the bank/ provider issuing the payment method to the end user\\n\",\"example\":\"Citibank\"},\"payment_method_issuer_code\":{\"type\":\"string\",\"description\":\"A standard code representing the issuer of payment method\\n\",\"example\":\"PM_APPLEPAY\"},\"card\":{\"type\":\"object\",\"description\":\"Card Payment Method object\",\"properties\":{\"last4_digits\":{\"type\":\"string\",\"description\":\"The last four digits of the case which could be displayed to the end user for identification.\",\"example\":\"xxxxxxxxxxxx4242\"},\"card_exp_month\":{\"type\":\"string\",\"description\":\"The expiry month for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"10\"},\"card_exp_year\":{\"type\":\"string\",\"description\":\"Expiry year for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"25\"},\"card_holder_name\":{\"type\":\"string\",\"description\":\"The name of card holder\",\"maxLength\":255,\"example\":\"John Doe\"},\"card_token\":{\"type\":\"string\",\"description\":\"The token provided against a user's saved card. The token would be valid for 15 minutes.\",\"minLength\":30,\"maxLength\":30,\"example\":\"tkn_78892490hfh3r834rd\"},\"scheme\":{\"type\":\"string\",\"description\":\"The card scheme network for the particular card\",\"example\":\"MASTER\"},\"issuer_country\":{\"type\":\"string\",\"description\":\"The country code in in which the card was issued\",\"minLength\":2,\"maxLength\":2,\"example\":\"US\"},\"card_fingerprint\":{\"type\":\"string\",\"description\":\"A unique identifier alias to identify a particular card.\",\"minLength\":30,\"maxLength\":30,\"example\":\"fpt_78892490hfh3r834rd\"}}},\"payment_scheme\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The network scheme to which the payment method belongs\\n\",\"example\":[\"MASTER\",\"VISA\"]}},\"accepted_country\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\\n\",\"example\":[\"US\",\"UK\",\"IN\"],\"maxLength\":2,\"minLength\":2}},\"accepted_currency\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":[\"USD\",\"EUR\"]}},\"minimum_amount\":{\"type\":\"integer\",\"description\":\"The minimum amount accepted for processing by the particular payment method.\\n\",\"example\":100},\"maximum_amount\":{\"type\":\"integer\",\"description\":\"The minimum amount accepted for processing by the particular payment method.\\n\",\"example\":10000000},\"recurring_payment_enabled\":{\"type\":\"boolean\",\"description\":\"Indicates whether the payment method is eligible for recurring payments\",\"example\":true},\"installment_payment_enabled\":{\"type\":\"boolean\",\"description\":\"Indicates whether the payment method is eligible for installment payments\",\"example\":true},\"payment_experience\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"This indicates type of action that is required in order to complete the payment with inputs from the user. This may involve actions such as redirecting the user to a URL, displaying a QR code, invoking the SDK client\",\"enum\":[\"redirect_to_url\",\"display_qr_code\",\"invoke_sdk_client\"],\"example\":[\"redirect_to_url\",\"display_qr_code\"]}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payment_methods/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "6c20d35a-cf65-4ce6-8b94-0fc9216319b8", - "name": "Delete PaymentMethods", - "request": { - "name": "Delete PaymentMethods", - "description": { - "content": "Detaches a PaymentMethod object from a Customer.", - "type": "text/plain" - }, - "url": { - "path": [ - "payment_methods", - ":id", - "detach" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the payment method", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "11e2a194-e9f4-403f-8112-cf0f34720d12", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/payment_methods/:id/detach - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/payment_methods/:id/detach - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Payment Method deletion confirmation\",\"required\":[\"payment_method_id\",\"deleted\"],\"properties\":{\"payment_method_id\":{\"type\":\"string\",\"description\":\"The identifier for the payment method object.\",\"maxLength\":30,\"example\":\"pm_y3oqhf46pyzuxjbcn2giaqnb44\"},\"deleted\":{\"type\":\"boolean\",\"description\":\"Indicates the deletion status of the payment method object.\",\"example\":true}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payment_methods/:id/detach - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - }, - { - "id": "3bc72a82-1f8f-426a-af76-8de19f452de2", - "name": "List payment methods for a Merchant", - "request": { - "name": "List payment methods for a Merchant", - "description": { - "content": "To filter and list the applicable payment methods for a particular merchant id.", - "type": "text/plain" - }, - "url": { - "path": [ - "payment_methods", - ":merchant_id", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [ - { - "disabled": false, - "key": "accepted_country", - "value": "ex" - }, - { - "disabled": false, - "key": "accepted_country", - "value": "an" - }, - { - "disabled": false, - "key": "accepted_currency", - "value": "pariatur id ullamco ad magna" - }, - { - "disabled": false, - "key": "accepted_currency", - "value": "commodo magna" - }, - { - "disabled": false, - "key": "minimum_amount", - "value": "100" - }, - { - "disabled": false, - "key": "maximum_amount", - "value": "10000000" - }, - { - "disabled": false, - "key": "recurring_payment_enabled", - "value": "true" - }, - { - "disabled": false, - "key": "installment_payment_enabled", - "value": "true" - } - ], - "variable": [ - { - "disabled": false, - "type": "any", - "value": "{{payment_method_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "3900e609-5bae-4e8b-aadb-fba1116ece56", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/payment_methods/:merchant_id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/payment_methods/:merchant_id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"array\",\"items\":{\"properties\":{\"payment_method\":{\"type\":\"string\",\"example\":\"card\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"]},\"payment_method_types\":{\"type\":\"array\",\"items\":{\"example\":[\"CREDIT\"],\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"]}},\"payment_method_issuers\":{\"type\":\"array\",\"description\":\"List of payment method issuers to be enabled for this payment method\",\"items\":{\"type\":\"string\",\"example\":[\"CHASE\",\"WELLS_FARGO\"]}},\"payment_method_issuer_codes\":{\"type\":\"string\",\"description\":\"A standard code representing the issuer of payment method\\n\",\"example\":[\"PM_CHASE\",\"PM_WELLS\"]},\"payment_schemes\":{\"type\":\"array\",\"description\":\"List of payment schemes accepted or has the processing capabilities of the processor\",\"items\":{\"example\":[\"MASTER\",\"VISA\",\"DINERS\"],\"type\":\"string\",\"description\":\"Represent the payment schemes and networks\",\"enum\":[\"VISA\",\"MasterCard\",\"Discover\",\"AMEX\"]}},\"accepted_currencies\":{\"type\":\"array\",\"description\":\"List of currencies accepted or has the processing capabilities of the processor\",\"items\":{\"example\":[\"USD\",\"EUR\",\"AED\"],\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3}},\"accepted_countries\":{\"type\":\"array\",\"description\":\"List of Countries accepted or has the processing capabilities of the processor\",\"items\":{\"example\":[\"US\",\"IN\"],\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2}},\"minimum_amount\":{\"type\":\"integer\",\"description\":\"Minimum amount supported by the processor. To be represented in the lowest denomination of the target currency (For example, for USD it should be in cents)\",\"example\":1},\"maximum_amount\":{\"type\":\"integer\",\"description\":\"Maximum amount supported by the processor. To be represented in the lowest denomination of the target currency (For example, for USD it should be in cents)\",\"example\":null},\"recurring_enabled\":{\"type\":\"boolean\",\"description\":\"Boolean to enable recurring payments / mandates. Default is true.\",\"example\":true},\"installment_payment_enabled\":{\"type\":\"boolean\",\"description\":\"Boolean to enable installment / EMI / BNPL payments. Default is true.\",\"example\":true},\"payment_experience\":{\"type\":\"array\",\"description\":\"Type of payment experience enabled with the connector\",\"items\":{\"type\":\"object\",\"description\":\"States the next action to complete the payment\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"example\":[\"redirect_to_url\"]}},\"type\":\"object\"}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payment_methods/:merchant_id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - } - ], - "event": [] - }, - { - "id": "1a875fba-2afc-4156-b06d-2cbf26dfd465", - "name": "Refunds", - "description": { - "content": "", - "type": "text/plain" - }, - "item": [ - { - "id": "b61204d6-6eef-4bc6-afe4-ce98fbdcb03d", - "name": "Refunds - Create", - "request": { - "name": "Refunds - Create", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\",\n \"amount\": 100,\n \"currency\": \"USD\",\n \"reason\": \"Customer returned product\",\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "6922adf4-4c33-4b30-9623-52d011b6bd11", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/refunds - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "3e84fa77-3ab3-40cb-b710-ecea01e8189d", - "name": "Refunds - Update", - "request": { - "name": "Refunds - Update", - "description": { - "content": "To update the properties of a Refund object. This may include attaching a reason for the refund or metadata fields", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique refund id", - "type": "text/plain" - }, - "type": "string", - "value": "{{refund_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"reason\": \"Customer returned product\",\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "33205aeb-e92b-4b39-8525-bd4bfe1e896f", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/refunds/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/refunds/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "1107a574-3e3f-4057-bc3d-6341d8d20f98", - "name": "Refunds - Retrieve", - "request": { - "name": "Refunds - Retrieve", - "description": { - "content": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique refund id", - "type": "text/plain" - }, - "type": "string", - "value": "{{refund_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "90f4d0d3-bfeb-4b2c-bf52-9b7e547627e2", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/refunds/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/refunds/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - } - ], - "event": [] - }, - { - "id": "71cda8fb-e354-4b51-a9f9-319553f3c073", - "name": "Mandates", - "description": { - "content": "", - "type": "text/plain" - }, - "item": [ - { - "id": "62b2ce2b-bf24-4994-ba56-5b488e899e4b", - "name": "Mandate - List all mandates against a customer id", - "request": { - "name": "Mandate - List all mandates against a customer id", - "description": { - "content": "To list the all the mandates for a customer", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":customer_id", - "mandates" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) Unique customer id for which the list of mandates to be retrieved.", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "customer_id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "afc3cd83-da57-49dc-8b65-b747a75a1ed1", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/customers/:customer_id/mandates - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/customers/:customer_id/mandates - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/customers/:customer_id/mandates - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"array\",\"items\":{\"type\":\"object\",\"description\":\"Mandate Payment Create Response\",\"required\":[\"mandate_id\",\"status\",\"payment_method_id\"],\"properties\":{\"mandate_id\":{\"type\":\"string\",\"description\":\"The unique id corresponding to the mandate.\\n\",\"example\":\"mandate_end38934n12s923d0\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the mandate, which indicates whether it can be used to initiate a payment.\",\"enum\":[\"active\",\"inactive\",\"pending\",\"revoked\"],\"example\":\"active\"},\"type\":{\"type\":\"string\",\"description\":\"The type of the mandate. (i) single_use refers to one-time mandates and (ii) multi-user refers to multiple payments.\",\"enum\":[\"multi_use\",\"single_use\"],\"default\":\"multi_use\",\"example\":\"multi_use\"},\"payment_method_id\":{\"type\":\"string\",\"description\":\"The id corresponding to the payment method.\",\"example\":\"pm_end38934n12s923d0\"},\"payment_method\":{\"type\":\"string\",\"description\":\"The type of payment method use for the payment.\\n\",\"enum\":[\"card\",\"payment_container\",\"bank_transfer\",\"bank_debit\",\"pay_later\",\"upi\",\"netbanking\"],\"example\":\"card\"},\"card\":{\"description\":\"The card identifier information to be displayed on the user interface\",\"type\":\"object\",\"properties\":{\"last4_digits\":{\"type\":\"string\",\"description\":\"The last four digits of the case which could be displayed to the end user for identification.\",\"example\":\"xxxxxxxxxxxx4242\"},\"card_exp_month\":{\"type\":\"string\",\"description\":\"The expiry month for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"10\"},\"card_exp_year\":{\"type\":\"string\",\"description\":\"Expiry year for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"25\"},\"card_holder_name\":{\"type\":\"string\",\"description\":\"The name of card holder\",\"maxLength\":255,\"example\":\"John Doe\"},\"card_token\":{\"type\":\"string\",\"description\":\"The token provided against a user's saved card. The token would be valid for 15 minutes.\",\"minLength\":30,\"maxLength\":30,\"example\":\"tkn_78892490hfh3r834rd\"},\"scheme\":{\"type\":\"string\",\"description\":\"The card scheme network for the particular card\",\"example\":\"MASTER\"},\"issuer_country\":{\"type\":\"string\",\"description\":\"The country code in in which the card was issued\",\"minLength\":2,\"maxLength\":2,\"example\":\"US\"},\"card_fingerprint\":{\"type\":\"string\",\"description\":\"A unique identifier alias to identify a particular card.\",\"minLength\":30,\"maxLength\":30,\"example\":\"fpt_78892490hfh3r834rd\"}}},\"customer_acceptance\":{\"description\":\"The card identifier information to be displayed on the user interface\",\"type\":\"object\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/customers/:customer_id/mandates - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - }, - { - "id": "9456626a-6997-4e0a-991c-f1d70eaaa1f9", - "name": "Mandate - List details of a mandate", - "request": { - "name": "Mandate - List details of a mandate", - "description": { - "content": "To list the details of a mandate", - "type": "text/plain" - }, - "url": { - "path": [ - "mandates", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) Unique mandate id", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [] - }, - { - "id": "e855b59b-9338-4f08-bc9c-284a7413464b", - "name": "Mandate - Revoke a mandate", - "request": { - "name": "Mandate - Revoke a mandate", - "description": { - "content": "To revoke a mandate registered against a customer", - "type": "text/plain" - }, - "url": { - "path": [ - "mandates", - ":id", - "revoke" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) Unique mandate id", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST" - }, - "response": [], - "event": [] - } - ], - "event": [] - }, - { - "id": "a78992b1-b748-4f07-aecc-7fe9b099cf5a", - "name": "MerchantAccounts", - "description": { - "content": "", - "type": "text/plain" - }, - "item": [ - { - "id": "7315f316-8db0-4544-b734-03208e8f42cb", - "name": "Merchant Account - Create", - "request": { - "name": "Merchant Account - Create", - "description": { - "content": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments.", - "type": "text/plain" - }, - "url": { - "path": [ - "accounts" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"merchant_id\": \"y3oqhf46pyzuxjbcn2giaqnb44\",\n \"merchant_name\": \"NewAge Retailer\",\n \"merchant_details\": {\n \"primary_contact_person\": \"John Test\",\n \"primary_email\": \"JohnTest@test.com\",\n \"primary_phone\": \"exercitation culpa fugiat qui sed\",\n \"secondary_contact_person\": \"John Test2\",\n \"secondary_email\": \"JohnTest2@test.com\",\n \"secondary_phone\": \"aliquip qui ea amet\",\n \"website\": \"www.example.com\",\n \"about_business\": \"Online Retail with a wide selection of organic products for North America\",\n \"address\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n }\n },\n \"return_url\": \"www.example.com/success\",\n \"webhook_details\": {\n \"webhook_version\": \"1.0.1\",\n \"webhook_username\": \"ekart_retail\",\n \"webhook_password\": \"password_ekart@123\",\n \"payment_created_enabled\": true,\n \"payment_succeeded_enabled\": true,\n \"payment_failed_enabled\": true\n },\n \"routing_algorithm\": \"custom\",\n \"custom_routing_rules\": [\n {\n \"payment_methods_incl\": [\n \"card\",\n \"card\"\n ],\n \"payment_methods_excl\": [\n \"card\",\n \"card\"\n ],\n \"payment_method_types_incl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_types_excl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_issuers_incl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"payment_method_issuers_excl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"countries_incl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"countries_excl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"currencies_incl\": [\n \"USD\",\n \"EUR\"\n ],\n \"currencies_excl\": [\n \"AED\",\n \"SGD\"\n ],\n \"metadata_filters_keys\": [\n \"payments.udf1\",\n \"payments.udf2\"\n ],\n \"metadata_filters_values\": [\n \"android\",\n \"Category_Electronics\"\n ],\n \"connectors_pecking_order\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_key\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_value\": [\n 50,\n 30,\n 20\n ]\n },\n {\n \"payment_methods_incl\": [\n \"card\",\n \"card\"\n ],\n \"payment_methods_excl\": [\n \"card\",\n \"card\"\n ],\n \"payment_method_types_incl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_types_excl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_issuers_incl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"payment_method_issuers_excl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"countries_incl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"countries_excl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"currencies_incl\": [\n \"USD\",\n \"EUR\"\n ],\n \"currencies_excl\": [\n \"AED\",\n \"SGD\"\n ],\n \"metadata_filters_keys\": [\n \"payments.udf1\",\n \"payments.udf2\"\n ],\n \"metadata_filters_values\": [\n \"android\",\n \"Category_Electronics\"\n ],\n \"connectors_pecking_order\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_key\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_value\": [\n 50,\n 30,\n 20\n ]\n }\n ],\n \"sub_merchants_enabled\": false,\n \"parent_merchant_id\": \"xkkdf909012sdjki2dkh5sdf\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "48d37cef-6acb-4dec-afe1-08c1ca306819", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/accounts - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/accounts - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Merchant Account\",\"required\":[\"merchant_id\"],\"properties\":{\"merchant_id\":{\"type\":\"string\",\"description\":\"The identifier for the Merchant Account.\",\"maxLength\":255,\"example\":\"y3oqhf46pyzuxjbcn2giaqnb44\"},\"api_key\":{\"type\":\"string\",\"description\":\"The public security key for accessing the APIs\",\"maxLength\":255,\"example\":\"xkkdf909012sdjki2dkh5sdf\"},\"merchant_name\":{\"type\":\"string\",\"description\":\"Name of the merchant\",\"example\":\"NewAge Retailer\"},\"merchant_details\":{\"type\":\"object\",\"description\":\"Details about the merchant including contact person, email, address, website, business description etc\",\"properties\":{\"primary_contact_person\":{\"type\":\"string\",\"description\":\"The merchant's primary contact name\",\"maxLength\":255,\"example\":\"John Test\"},\"primary_email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The merchant's primary email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"primary_phone\":{\"type\":\"string\",\"description\":\"The merchant's primary phone number\",\"maxLength\":255,\"example\":9999999999},\"secondary_contact_person\":{\"type\":\"string\",\"description\":\"The merchant's secondary contact name\",\"maxLength\":255,\"example\":\"John Test2\"},\"secondary_email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The merchant's secondary email address\",\"maxLength\":255,\"example\":\"JohnTest2@test.com\"},\"secondary_phone\":{\"type\":\"string\",\"description\":\"The merchant's secondary phone number\",\"maxLength\":255,\"example\":9999999998},\"website\":{\"type\":\"string\",\"description\":\"The business website of the merchant\",\"maxLength\":255,\"example\":\"www.example.com\"},\"about_business\":{\"type\":\"string\",\"description\":\"A brief description about merchant's business\",\"maxLength\":255,\"example\":\"Online Retail with a wide selection of organic products for North America\"},\"address\":{\"type\":\"object\",\"description\":\"The address for the merchant\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}}}},\"webhook_details\":{\"type\":\"object\",\"description\":\"The features for Webhook\",\"properties\":{\"webhook_version\":{\"type\":\"string\",\"description\":\"The version for Webhook\",\"maxLength\":255,\"example\":\"1.0.1\"},\"webhook_username\":{\"type\":\"string\",\"description\":\"The user name for Webhook login\",\"maxLength\":255,\"example\":\"ekart_retail\"},\"webhook_password\":{\"type\":\"string\",\"description\":\"The password for Webhook login\",\"maxLength\":255,\"example\":\"password_ekart@123\"},\"payment_created_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a new payment is created\",\"example\":true},\"payment_succeeded_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a payment is successful\",\"example\":true},\"payment_failed_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a payment fails\",\"example\":true}}},\"routing_algorithm\":{\"type\":\"string\",\"description\":\"The routing algorithm to be used to process the incoming request from merchant to outgoing payment processor or payment method. The default is CUSTOM if\",\"enum\":[\"round_robin\",\"max_conversion\",\"min_cost\",\"custom\"],\"maxLength\":255,\"example\":\"custom\"},\"custom_routing_rules\":{\"type\":\"array\",\"description\":\"An array of custom routing rules\",\"items\":{\"properties\":{\"payment_methods_incl\":{\"type\":\"array\",\"description\":\"The List of payment methods to include for this routing rule\",\"items\":{\"type\":\"string\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"],\"example\":\"card\"},\"example\":[\"card\",\"upi\"]},\"payment_methods_excl\":{\"type\":\"array\",\"description\":\"The List of payment methods to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"],\"example\":\"card\"},\"example\":[\"card\",\"upi\"]},\"payment_method_types_incl\":{\"type\":\"array\",\"description\":\"The List of payment method types to include for this routing rule\",\"items\":{\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"],\"example\":\"credit_card\"},\"example\":[\"credit_card\",\"debit_card\"]},\"payment_method_types_excl\":{\"type\":\"array\",\"description\":\"The List of payment method types to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"],\"example\":\"credit_card\"},\"example\":[\"credit_card\",\"debit_card\"]},\"payment_method_issuers_incl\":{\"type\":\"array\",\"description\":\"The List of payment method issuers to include for this routing rule\",\"items\":{\"type\":\"string\"},\"example\":[\"Citibank\",\"JPMorgan\"]},\"payment_method_issuers_excl\":{\"type\":\"array\",\"description\":\"The List of payment method issuers to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\"},\"example\":[\"Citibank\",\"JPMorgan\"]},\"countries_incl\":{\"type\":\"array\",\"description\":\"The List of countries to include for this routing rule\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2,\"example\":\"US\"},\"example\":[\"US\",\"UK\",\"IN\"]},\"countries_excl\":{\"type\":\"array\",\"description\":\"The List of countries to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2,\"example\":\"US\"},\"example\":[\"US\",\"UK\",\"IN\"]},\"currencies_incl\":{\"type\":\"array\",\"description\":\"The List of currencies to include for this routing rule\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3,\"example\":\"USD\"},\"example\":[\"USD\",\"EUR\"]},\"currencies_excl\":{\"type\":\"array\",\"description\":\"The List of currencies to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3,\"example\":\"USD\"},\"example\":[\"AED\",\"SGD\"]},\"metadata_filters_keys\":{\"type\":\"array\",\"description\":\"List of Metadata Filters to apply for the Routing Rule. The filters are presented as 2 arrays of keys and value. This property contains all the keys.\",\"items\":{\"type\":\"string\"},\"example\":[\"payments.udf1\",\"payments.udf2\"]},\"metadata_filters_values\":{\"type\":\"array\",\"description\":\"List of Metadata Filters to apply for the Routing Rule. The filters are presented as 2 arrays of keys and value. This property contains all the keys.\",\"items\":{\"type\":\"string\"},\"example\":[\"android\",\"Category_Electronics\"]},\"connectors_pecking_order\":{\"type\":\"array\",\"description\":\"The pecking order of payment connectors (or processors) to be used for routing. The first connector in the array will be attempted for routing. If it fails, the second connector will be used till the list is exhausted.\",\"items\":{\"type\":\"string\",\"description\":\"Unique name used for identifying the Connector\",\"enum\":[\"stripe\",\"adyen\",\"brain_tree\",\"dlocal\",\"cyber_source\"],\"example\":\"stripe\"},\"example\":[\"stripe\",\"adyen\",\"brain_tree\"]},\"connectors_traffic_weightage_key\":{\"type\":\"array\",\"description\":\"An Array of Connectors (as Keys) with the associated percentage of traffic to be routed through the given connector (Expressed as an array of values)\",\"items\":{\"type\":\"string\",\"description\":\"Unique name used for identifying the Connector\",\"enum\":[\"stripe\",\"adyen\",\"brain_tree\",\"dlocal\",\"cyber_source\"],\"example\":\"stripe\"},\"example\":[\"stripe\",\"adyen\",\"brain_tree\"]},\"connectors_traffic_weightage_value\":{\"type\":\"array\",\"description\":\"An Array of Weightage (expressed in percentage) that needs to be associated with the respective connectors (Expressed as an array of keys)\",\"items\":{\"type\":\"integer\",\"minimum\":0,\"maximum\":100,\"example\":50},\"example\":[50,30,20]}},\"example\":[{\"payment_method_types_incl\":[\"credit_card\"],\"connectors_pecking_order\":[\"stripe\",\"adyen\",\"brain_tree\"]},{\"payment_method_types_incl\":[\"debit_card\"],\"connectors_traffic_weightage_key\":[\"stripe\",\"adyen\",\"brain_tree\"],\"connectors_traffic_weightage_value\":[50,30,20]}],\"type\":\"object\"}},\"sub_merchants_enabled\":{\"type\":\"boolean\",\"description\":\"A boolean value to indicate if the merchant is a sub-merchant under a master or a parent merchant. By default, its value is false.\",\"maxLength\":255,\"example\":false},\"parent_merchant_id\":{\"type\":\"string\",\"description\":\"Refers to the Parent Merchant ID if the merchant being created is a sub-merchant\",\"maxLength\":255,\"example\":\"xkkdf909012sdjki2dkh5sdf\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/accounts - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "d79cc4de-c0df-4692-b730-9132d91ea7b8", - "name": "Merchant Account - Retrieve", - "request": { - "name": "Merchant Account - Retrieve", - "description": { - "content": "Retrieve a merchant account details.", - "type": "text/plain" - }, - "url": { - "path": [ - "accounts", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the merchant account", - "type": "text/plain" - }, - "type": "string", - "value": "{{merchant_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET", - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "031f4670-bfeb-4c6f-84c8-b5f81c35f8fe", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[GET]::/accounts/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[GET]::/accounts/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Merchant Account\",\"required\":[\"merchant_id\"],\"properties\":{\"merchant_id\":{\"type\":\"string\",\"description\":\"The identifier for the Merchant Account.\",\"maxLength\":255,\"example\":\"y3oqhf46pyzuxjbcn2giaqnb44\"},\"api_key\":{\"type\":\"string\",\"description\":\"The public security key for accessing the APIs\",\"maxLength\":255,\"example\":\"xkkdf909012sdjki2dkh5sdf\"},\"merchant_name\":{\"type\":\"string\",\"description\":\"Name of the merchant\",\"example\":\"NewAge Retailer\"},\"merchant_details\":{\"type\":\"object\",\"description\":\"Details about the merchant including contact person, email, address, website, business description etc\",\"properties\":{\"primary_contact_person\":{\"type\":\"string\",\"description\":\"The merchant's primary contact name\",\"maxLength\":255,\"example\":\"John Test\"},\"primary_email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The merchant's primary email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"primary_phone\":{\"type\":\"string\",\"description\":\"The merchant's primary phone number\",\"maxLength\":255,\"example\":9999999999},\"secondary_contact_person\":{\"type\":\"string\",\"description\":\"The merchant's secondary contact name\",\"maxLength\":255,\"example\":\"John Test2\"},\"secondary_email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The merchant's secondary email address\",\"maxLength\":255,\"example\":\"JohnTest2@test.com\"},\"secondary_phone\":{\"type\":\"string\",\"description\":\"The merchant's secondary phone number\",\"maxLength\":255,\"example\":9999999998},\"website\":{\"type\":\"string\",\"description\":\"The business website of the merchant\",\"maxLength\":255,\"example\":\"www.example.com\"},\"about_business\":{\"type\":\"string\",\"description\":\"A brief description about merchant's business\",\"maxLength\":255,\"example\":\"Online Retail with a wide selection of organic products for North America\"},\"address\":{\"type\":\"object\",\"description\":\"The address for the merchant\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}}}},\"webhook_details\":{\"type\":\"object\",\"description\":\"The features for Webhook\",\"properties\":{\"webhook_version\":{\"type\":\"string\",\"description\":\"The version for Webhook\",\"maxLength\":255,\"example\":\"1.0.1\"},\"webhook_username\":{\"type\":\"string\",\"description\":\"The user name for Webhook login\",\"maxLength\":255,\"example\":\"ekart_retail\"},\"webhook_password\":{\"type\":\"string\",\"description\":\"The password for Webhook login\",\"maxLength\":255,\"example\":\"password_ekart@123\"},\"payment_created_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a new payment is created\",\"example\":true},\"payment_succeeded_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a payment is successful\",\"example\":true},\"payment_failed_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a payment fails\",\"example\":true}}},\"routing_algorithm\":{\"type\":\"string\",\"description\":\"The routing algorithm to be used to process the incoming request from merchant to outgoing payment processor or payment method. The default is CUSTOM if\",\"enum\":[\"round_robin\",\"max_conversion\",\"min_cost\",\"custom\"],\"maxLength\":255,\"example\":\"custom\"},\"custom_routing_rules\":{\"type\":\"array\",\"description\":\"An array of custom routing rules\",\"items\":{\"properties\":{\"payment_methods_incl\":{\"type\":\"array\",\"description\":\"The List of payment methods to include for this routing rule\",\"items\":{\"type\":\"string\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"],\"example\":\"card\"},\"example\":[\"card\",\"upi\"]},\"payment_methods_excl\":{\"type\":\"array\",\"description\":\"The List of payment methods to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"],\"example\":\"card\"},\"example\":[\"card\",\"upi\"]},\"payment_method_types_incl\":{\"type\":\"array\",\"description\":\"The List of payment method types to include for this routing rule\",\"items\":{\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"],\"example\":\"credit_card\"},\"example\":[\"credit_card\",\"debit_card\"]},\"payment_method_types_excl\":{\"type\":\"array\",\"description\":\"The List of payment method types to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"],\"example\":\"credit_card\"},\"example\":[\"credit_card\",\"debit_card\"]},\"payment_method_issuers_incl\":{\"type\":\"array\",\"description\":\"The List of payment method issuers to include for this routing rule\",\"items\":{\"type\":\"string\"},\"example\":[\"Citibank\",\"JPMorgan\"]},\"payment_method_issuers_excl\":{\"type\":\"array\",\"description\":\"The List of payment method issuers to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\"},\"example\":[\"Citibank\",\"JPMorgan\"]},\"countries_incl\":{\"type\":\"array\",\"description\":\"The List of countries to include for this routing rule\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2,\"example\":\"US\"},\"example\":[\"US\",\"UK\",\"IN\"]},\"countries_excl\":{\"type\":\"array\",\"description\":\"The List of countries to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2,\"example\":\"US\"},\"example\":[\"US\",\"UK\",\"IN\"]},\"currencies_incl\":{\"type\":\"array\",\"description\":\"The List of currencies to include for this routing rule\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3,\"example\":\"USD\"},\"example\":[\"USD\",\"EUR\"]},\"currencies_excl\":{\"type\":\"array\",\"description\":\"The List of currencies to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3,\"example\":\"USD\"},\"example\":[\"AED\",\"SGD\"]},\"metadata_filters_keys\":{\"type\":\"array\",\"description\":\"List of Metadata Filters to apply for the Routing Rule. The filters are presented as 2 arrays of keys and value. This property contains all the keys.\",\"items\":{\"type\":\"string\"},\"example\":[\"payments.udf1\",\"payments.udf2\"]},\"metadata_filters_values\":{\"type\":\"array\",\"description\":\"List of Metadata Filters to apply for the Routing Rule. The filters are presented as 2 arrays of keys and value. This property contains all the keys.\",\"items\":{\"type\":\"string\"},\"example\":[\"android\",\"Category_Electronics\"]},\"connectors_pecking_order\":{\"type\":\"array\",\"description\":\"The pecking order of payment connectors (or processors) to be used for routing. The first connector in the array will be attempted for routing. If it fails, the second connector will be used till the list is exhausted.\",\"items\":{\"type\":\"string\",\"description\":\"Unique name used for identifying the Connector\",\"enum\":[\"stripe\",\"adyen\",\"brain_tree\",\"dlocal\",\"cyber_source\"],\"example\":\"stripe\"},\"example\":[\"stripe\",\"adyen\",\"brain_tree\"]},\"connectors_traffic_weightage_key\":{\"type\":\"array\",\"description\":\"An Array of Connectors (as Keys) with the associated percentage of traffic to be routed through the given connector (Expressed as an array of values)\",\"items\":{\"type\":\"string\",\"description\":\"Unique name used for identifying the Connector\",\"enum\":[\"stripe\",\"adyen\",\"brain_tree\",\"dlocal\",\"cyber_source\"],\"example\":\"stripe\"},\"example\":[\"stripe\",\"adyen\",\"brain_tree\"]},\"connectors_traffic_weightage_value\":{\"type\":\"array\",\"description\":\"An Array of Weightage (expressed in percentage) that needs to be associated with the respective connectors (Expressed as an array of keys)\",\"items\":{\"type\":\"integer\",\"minimum\":0,\"maximum\":100,\"example\":50},\"example\":[50,30,20]}},\"example\":[{\"payment_method_types_incl\":[\"credit_card\"],\"connectors_pecking_order\":[\"stripe\",\"adyen\",\"brain_tree\"]},{\"payment_method_types_incl\":[\"debit_card\"],\"connectors_traffic_weightage_key\":[\"stripe\",\"adyen\",\"brain_tree\"],\"connectors_traffic_weightage_value\":[50,30,20]}],\"type\":\"object\"}},\"sub_merchants_enabled\":{\"type\":\"boolean\",\"description\":\"A boolean value to indicate if the merchant is a sub-merchant under a master or a parent merchant. By default, its value is false.\",\"maxLength\":255,\"example\":false},\"parent_merchant_id\":{\"type\":\"string\",\"description\":\"Refers to the Parent Merchant ID if the merchant being created is a sub-merchant\",\"maxLength\":255,\"example\":\"xkkdf909012sdjki2dkh5sdf\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/accounts/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - }, - { - "id": "9b6ff150-17fb-4e32-8007-a704e18159e4", - "name": "Merchant Account - Update", - "request": { - "name": "Merchant Account - Update", - "description": { - "content": "To update an existing merchant account. Helpful in updating merchant details such as email, contact details, or other configuration details like webhook, routing algorithm etc", - "type": "text/plain" - }, - "url": { - "path": [ - "accounts", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the merchant account", - "type": "text/plain" - }, - "type": "string", - "value": "{{merchant_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"merchant_id\": \"y3oqhf46pyzuxjbcn2giaqnb44\",\n \"merchant_name\": \"NewAge Retailer\",\n \"merchant_details\": {\n \"primary_contact_person\": \"John Test\",\n \"primary_email\": \"JohnTest@test.com\",\n \"primary_phone\": \"cillum eu\",\n \"secondary_contact_person\": \"John Test2\",\n \"secondary_email\": \"JohnTest2@test.com\",\n \"secondary_phone\": \"incididunt Excepteur ut eu do\",\n \"website\": \"www.example.com\",\n \"about_business\": \"Online Retail with a wide selection of organic products for North America\",\n \"address\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n }\n },\n \"return_url\": \"www.example.com/success\",\n \"webhook_details\": {\n \"webhook_version\": \"1.0.1\",\n \"webhook_username\": \"ekart_retail\",\n \"webhook_password\": \"password_ekart@123\",\n \"payment_created_enabled\": true,\n \"payment_succeeded_enabled\": true,\n \"payment_failed_enabled\": true\n },\n \"routing_algorithm\": \"custom\",\n \"custom_routing_rules\": [\n {\n \"payment_methods_incl\": [\n \"card\",\n \"card\"\n ],\n \"payment_methods_excl\": [\n \"card\",\n \"card\"\n ],\n \"payment_method_types_incl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_types_excl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_issuers_incl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"payment_method_issuers_excl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"countries_incl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"countries_excl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"currencies_incl\": [\n \"USD\",\n \"EUR\"\n ],\n \"currencies_excl\": [\n \"AED\",\n \"SGD\"\n ],\n \"metadata_filters_keys\": [\n \"payments.udf1\",\n \"payments.udf2\"\n ],\n \"metadata_filters_values\": [\n \"android\",\n \"Category_Electronics\"\n ],\n \"connectors_pecking_order\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_key\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_value\": [\n 50,\n 30,\n 20\n ]\n },\n {\n \"payment_methods_incl\": [\n \"card\",\n \"card\"\n ],\n \"payment_methods_excl\": [\n \"card\",\n \"card\"\n ],\n \"payment_method_types_incl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_types_excl\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_issuers_incl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"payment_method_issuers_excl\": [\n \"Citibank\",\n \"JPMorgan\"\n ],\n \"countries_incl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"countries_excl\": [\n \"US\",\n \"UK\",\n \"IN\"\n ],\n \"currencies_incl\": [\n \"USD\",\n \"EUR\"\n ],\n \"currencies_excl\": [\n \"AED\",\n \"SGD\"\n ],\n \"metadata_filters_keys\": [\n \"payments.udf1\",\n \"payments.udf2\"\n ],\n \"metadata_filters_values\": [\n \"android\",\n \"Category_Electronics\"\n ],\n \"connectors_pecking_order\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_key\": [\n \"stripe\",\n \"adyen\",\n \"brain_tree\"\n ],\n \"connectors_traffic_weightage_value\": [\n 50,\n 30,\n 20\n ]\n }\n ],\n \"sub_merchants_enabled\": false,\n \"parent_merchant_id\": \"xkkdf909012sdjki2dkh5sdf\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "c0fd54f8-21ba-42b6-942a-95cfab416b64", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[POST]::/accounts/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[POST]::/accounts/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Merchant Account\",\"required\":[\"merchant_id\"],\"properties\":{\"merchant_id\":{\"type\":\"string\",\"description\":\"The identifier for the Merchant Account.\",\"maxLength\":255,\"example\":\"y3oqhf46pyzuxjbcn2giaqnb44\"},\"api_key\":{\"type\":\"string\",\"description\":\"The public security key for accessing the APIs\",\"maxLength\":255,\"example\":\"xkkdf909012sdjki2dkh5sdf\"},\"merchant_name\":{\"type\":\"string\",\"description\":\"Name of the merchant\",\"example\":\"NewAge Retailer\"},\"merchant_details\":{\"type\":\"object\",\"description\":\"Details about the merchant including contact person, email, address, website, business description etc\",\"properties\":{\"primary_contact_person\":{\"type\":\"string\",\"description\":\"The merchant's primary contact name\",\"maxLength\":255,\"example\":\"John Test\"},\"primary_email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The merchant's primary email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"primary_phone\":{\"type\":\"string\",\"description\":\"The merchant's primary phone number\",\"maxLength\":255,\"example\":9999999999},\"secondary_contact_person\":{\"type\":\"string\",\"description\":\"The merchant's secondary contact name\",\"maxLength\":255,\"example\":\"John Test2\"},\"secondary_email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The merchant's secondary email address\",\"maxLength\":255,\"example\":\"JohnTest2@test.com\"},\"secondary_phone\":{\"type\":\"string\",\"description\":\"The merchant's secondary phone number\",\"maxLength\":255,\"example\":9999999998},\"website\":{\"type\":\"string\",\"description\":\"The business website of the merchant\",\"maxLength\":255,\"example\":\"www.example.com\"},\"about_business\":{\"type\":\"string\",\"description\":\"A brief description about merchant's business\",\"maxLength\":255,\"example\":\"Online Retail with a wide selection of organic products for North America\"},\"address\":{\"type\":\"object\",\"description\":\"The address for the merchant\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}}}},\"webhook_details\":{\"type\":\"object\",\"description\":\"The features for Webhook\",\"properties\":{\"webhook_version\":{\"type\":\"string\",\"description\":\"The version for Webhook\",\"maxLength\":255,\"example\":\"1.0.1\"},\"webhook_username\":{\"type\":\"string\",\"description\":\"The user name for Webhook login\",\"maxLength\":255,\"example\":\"ekart_retail\"},\"webhook_password\":{\"type\":\"string\",\"description\":\"The password for Webhook login\",\"maxLength\":255,\"example\":\"password_ekart@123\"},\"payment_created_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a new payment is created\",\"example\":true},\"payment_succeeded_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a payment is successful\",\"example\":true},\"payment_failed_enabled\":{\"type\":\"boolean\",\"description\":\"If this property is true, a webhook message is posted whenever a payment fails\",\"example\":true}}},\"routing_algorithm\":{\"type\":\"string\",\"description\":\"The routing algorithm to be used to process the incoming request from merchant to outgoing payment processor or payment method. The default is CUSTOM if\",\"enum\":[\"round_robin\",\"max_conversion\",\"min_cost\",\"custom\"],\"maxLength\":255,\"example\":\"custom\"},\"custom_routing_rules\":{\"type\":\"array\",\"description\":\"An array of custom routing rules\",\"items\":{\"properties\":{\"payment_methods_incl\":{\"type\":\"array\",\"description\":\"The List of payment methods to include for this routing rule\",\"items\":{\"type\":\"string\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"],\"example\":\"card\"},\"example\":[\"card\",\"upi\"]},\"payment_methods_excl\":{\"type\":\"array\",\"description\":\"The List of payment methods to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"enum\":[\"card\",\"wallet\",\"bank_debit\",\"bank_redirect\",\"bank_transfer\"],\"example\":\"card\"},\"example\":[\"card\",\"upi\"]},\"payment_method_types_incl\":{\"type\":\"array\",\"description\":\"The List of payment method types to include for this routing rule\",\"items\":{\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"],\"example\":\"credit_card\"},\"example\":[\"credit_card\",\"debit_card\"]},\"payment_method_types_excl\":{\"type\":\"array\",\"description\":\"The List of payment method types to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"enum\":[\"credit_card\",\"debit_card\",\"upi_intent\",\"upi_collect\"],\"example\":\"credit_card\"},\"example\":[\"credit_card\",\"debit_card\"]},\"payment_method_issuers_incl\":{\"type\":\"array\",\"description\":\"The List of payment method issuers to include for this routing rule\",\"items\":{\"type\":\"string\"},\"example\":[\"Citibank\",\"JPMorgan\"]},\"payment_method_issuers_excl\":{\"type\":\"array\",\"description\":\"The List of payment method issuers to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\"},\"example\":[\"Citibank\",\"JPMorgan\"]},\"countries_incl\":{\"type\":\"array\",\"description\":\"The List of countries to include for this routing rule\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2,\"example\":\"US\"},\"example\":[\"US\",\"UK\",\"IN\"]},\"countries_excl\":{\"type\":\"array\",\"description\":\"The List of countries to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"description\":\"The two-letter ISO currency code\",\"maxLength\":2,\"minLength\":2,\"example\":\"US\"},\"example\":[\"US\",\"UK\",\"IN\"]},\"currencies_incl\":{\"type\":\"array\",\"description\":\"The List of currencies to include for this routing rule\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3,\"example\":\"USD\"},\"example\":[\"USD\",\"EUR\"]},\"currencies_excl\":{\"type\":\"array\",\"description\":\"The List of currencies to exclude for this routing rule. If there is conflict between include and exclude lists, include list overrides the exclude list.\",\"items\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\",\"maxLength\":3,\"minLength\":3,\"example\":\"USD\"},\"example\":[\"AED\",\"SGD\"]},\"metadata_filters_keys\":{\"type\":\"array\",\"description\":\"List of Metadata Filters to apply for the Routing Rule. The filters are presented as 2 arrays of keys and value. This property contains all the keys.\",\"items\":{\"type\":\"string\"},\"example\":[\"payments.udf1\",\"payments.udf2\"]},\"metadata_filters_values\":{\"type\":\"array\",\"description\":\"List of Metadata Filters to apply for the Routing Rule. The filters are presented as 2 arrays of keys and value. This property contains all the keys.\",\"items\":{\"type\":\"string\"},\"example\":[\"android\",\"Category_Electronics\"]},\"connectors_pecking_order\":{\"type\":\"array\",\"description\":\"The pecking order of payment connectors (or processors) to be used for routing. The first connector in the array will be attempted for routing. If it fails, the second connector will be used till the list is exhausted.\",\"items\":{\"type\":\"string\",\"description\":\"Unique name used for identifying the Connector\",\"enum\":[\"stripe\",\"adyen\",\"brain_tree\",\"dlocal\",\"cyber_source\"],\"example\":\"stripe\"},\"example\":[\"stripe\",\"adyen\",\"brain_tree\"]},\"connectors_traffic_weightage_key\":{\"type\":\"array\",\"description\":\"An Array of Connectors (as Keys) with the associated percentage of traffic to be routed through the given connector (Expressed as an array of values)\",\"items\":{\"type\":\"string\",\"description\":\"Unique name used for identifying the Connector\",\"enum\":[\"stripe\",\"adyen\",\"brain_tree\",\"dlocal\",\"cyber_source\"],\"example\":\"stripe\"},\"example\":[\"stripe\",\"adyen\",\"brain_tree\"]},\"connectors_traffic_weightage_value\":{\"type\":\"array\",\"description\":\"An Array of Weightage (expressed in percentage) that needs to be associated with the respective connectors (Expressed as an array of keys)\",\"items\":{\"type\":\"integer\",\"minimum\":0,\"maximum\":100,\"example\":50},\"example\":[50,30,20]}},\"example\":[{\"payment_method_types_incl\":[\"credit_card\"],\"connectors_pecking_order\":[\"stripe\",\"adyen\",\"brain_tree\"]},{\"payment_method_types_incl\":[\"debit_card\"],\"connectors_traffic_weightage_key\":[\"stripe\",\"adyen\",\"brain_tree\"],\"connectors_traffic_weightage_value\":[50,30,20]}],\"type\":\"object\"}},\"sub_merchants_enabled\":{\"type\":\"boolean\",\"description\":\"A boolean value to indicate if the merchant is a sub-merchant under a master or a parent merchant. By default, its value is false.\",\"maxLength\":255,\"example\":false},\"parent_merchant_id\":{\"type\":\"string\",\"description\":\"Refers to the Parent Merchant ID if the merchant being created is a sub-merchant\",\"maxLength\":255,\"example\":\"xkkdf909012sdjki2dkh5sdf\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/accounts/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "35d41c36-fd59-439e-9184-9cd13fb89d99", - "name": "Merchant Account - Delete", - "request": { - "name": "Merchant Account - Delete", - "description": { - "content": "Delete a Merchant Account", - "type": "text/plain" - }, - "url": { - "path": [ - "accounts", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the merchant account", - "type": "text/plain" - }, - "type": "string", - "value": "{{merchant_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "51469ec0-2696-4381-8df9-82eb3b0ea382", - "type": "text/javascript", - "exec": [ - "// Validate status 2xx \npm.test(\"[DELETE]::/accounts/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", - "// Validate if response header has matching content-type\npm.test(\"[DELETE]::/accounts/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Merchant Account\",\"required\":[\"merchant_id\",\"deleted\"],\"properties\":{\"merchant_id\":{\"type\":\"string\",\"description\":\"The identifier for the MerchantAccount object.\",\"maxLength\":255,\"example\":\"y3oqhf46pyzuxjbcn2giaqnb44\"},\"deleted\":{\"type\":\"boolean\",\"description\":\"Indicates the deletion status of the Merchant Account object.\",\"example\":true}}}\n\n// Validate if response matches JSON schema \npm.test(\"[DELETE]::/accounts/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" - ] - } - } - ] - } - ], - "event": [] - }, - { - "id": "dd82fa22-ab73-45e5-a217-6d229261d78f", - "name": "PaymentConnectors", - "description": { - "content": "", - "type": "text/plain" - }, - "item": [ - { - "id": "d8bf36be-6b51-4fa3-90c7-72b90a83db6f", - "name": "Payment Connector - Create", - "request": { - "name": "Payment Connector - Create", - "description": { - "content": "Create a new Payment Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc.", - "type": "text/plain" - }, - "url": { - "path": [ - "account", - ":account_id", - "connectors" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the merchant account", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "account_id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"merchant_id\": \"y3oqhf46pyzuxjbcn2giaqnb44\",\n \"connector_type\": \"banking_entities\",\n \"connector_name\": \"stripe\",\n \"connector_account_details\": {\n \"api_key\": \"Basic MyVerySecretApiKey\"\n },\n \"test_mode\": false,\n \"disabled\": false,\n \"payment_methods_enabled\": [\n {\n \"payment_method\": \"card\",\n \"payment_method_types\": [\n \"credit_card\",\n \"credit_card\"\n ],\n \"payment_method_issuers\": [\n \"fugiat cupidatat Excepteur consequat\",\n \"id exercitation\"\n ],\n \"payment_schemes\": [\n \"VISA\",\n \"VISA\"\n ],\n \"accepted_currencies\": [\n \"ali\",\n \"in \"\n ],\n \"accepted_countries\": [\n \"cu\",\n \"do\"\n ],\n \"minimum_amount\": 1,\n \"maximum_amount\": 81344444,\n \"recurring_enabled\": true,\n \"installment_payment_enabled\": true,\n \"payment_experience\": [\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n },\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n }\n ]\n },\n {\n \"payment_method\": \"card\",\n \"payment_method_types\": [\n \"upi_collect\",\n \"upi_intent\"\n ],\n \"payment_method_issuers\": [\n \"velit deserunt\",\n \"Duis in Lor\"\n ],\n \"payment_schemes\": [\n \"Discover\",\n \"AMEX\"\n ],\n \"accepted_currencies\": [\n \"nis\",\n \"com\"\n ],\n \"accepted_countries\": [\n \"do\",\n \"co\"\n ],\n \"minimum_amount\": 1,\n \"maximum_amount\": 73640015,\n \"recurring_enabled\": true,\n \"installment_payment_enabled\": true,\n \"payment_experience\": [\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n },\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "e92e3907-44dc-4aea-aca6-dcbad659a1cd", - "name": "Payment Connector - Retrieve", - "request": { - "name": "Payment Connector - Retrieve", - "description": { - "content": "Retrieve Payment Connector details.", - "type": "text/plain" - }, - "url": { - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the merchant account", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "account_id" - }, - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the payment connector", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "connector_id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET", - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [] - }, - { - "id": "2ebf178e-f037-4401-b861-a0ff209e57e1", - "name": "Payment Connector - Update", - "request": { - "name": "Payment Connector - Update", - "description": { - "content": "To update an existing Payment Connector. Helpful in enabling / disabling different payment methods and other settings for the connector etc", - "type": "text/plain" - }, - "url": { - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the merchant account", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "id1" - }, - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the payment connector", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "id2" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"merchant_id\": \"y3oqhf46pyzuxjbcn2giaqnb44\",\n \"connector_type\": \"payment_processor\",\n \"connector_name\": \"stripe\",\n \"connector_id\": -86626583,\n \"connector_account_details\": {\n \"processing_fee\": \"2.0%\",\n \"billing_currency\": \"USD\"\n },\n \"test_mode\": false,\n \"disabled\": false,\n \"payment_methods\": [\n {\n \"payment_method\": \"card\",\n \"payment_method_types\": [\n \"credit_card\",\n \"debit_card\"\n ],\n \"payment_method_issuers\": [\n \"sint sunt\",\n \"qui\"\n ],\n \"payment_schemes\": [\n \"MasterCard\",\n \"Discover\"\n ],\n \"accepted_currencies\": [\n \"com\",\n \"ad \"\n ],\n \"accepted_countries\": [\n \"co\",\n \"Ex\"\n ],\n \"minimum_amount\": 1,\n \"maximum_amount\": -51372912,\n \"recurring_enabled\": true,\n \"installment_payment_enabled\": true,\n \"payment_experience\": [\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n },\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n }\n ]\n },\n {\n \"payment_method\": \"card\",\n \"payment_method_types\": [\n \"upi_intent\",\n \"upi_intent\"\n ],\n \"payment_method_issuers\": [\n \"occaecat sed laboris sunt\",\n \"qui eu sint Lorem\"\n ],\n \"payment_schemes\": [\n \"MasterCard\",\n \"MasterCard\"\n ],\n \"accepted_currencies\": [\n \"sed\",\n \"ven\"\n ],\n \"accepted_countries\": [\n \"re\",\n \"si\"\n ],\n \"minimum_amount\": 1,\n \"maximum_amount\": 31397497,\n \"recurring_enabled\": true,\n \"installment_payment_enabled\": true,\n \"payment_experience\": [\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n },\n {\n \"redirect_to_url\": \"https://pg-redirect-page.com\",\n \"display_qr_code\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\",\n \"invoke_payment_app\": {\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"invoke_sdk_client\": {\n \"sdk_name\": \"gpay\",\n \"sdk_params\": {\n \"param1\": \"value\",\n \"param2\": \"value\"\n },\n \"intent_uri\": \"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"\n },\n \"trigger_api\": {\n \"api_name\": \"submit_otp\",\n \"doc\": \"https://router.juspay.io/api-reference/submit_otp\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "fae35dfd-c59b-46f6-9b9d-5fcb45f53fe9", - "name": "Payment Connector - Delete", - "request": { - "name": "Payment Connector - Delete", - "description": { - "content": "Delete or Detach a Payment Connector from Merchant Account", - "type": "text/plain" - }, - "url": { - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the merchant account", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "id1" - }, - { - "disabled": false, - "description": { - "content": "(Required) The unique identifier for the payment connector", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "id2" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "admin-api-key", - "key": "key" - }, - { - "type": "any", - "value": "", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - } - }, - "response": [], - "event": [] - } - ], - "event": [] - }, - { - "id": "50492fc0-c059-4caf-81cf-94be5d9f29a8", - "name": "Variation Tests", - "item": [ - { - "id": "6c7496a9-8ffe-43bf-bb04-a6a5db2214e2", - "name": "Customers Variations", - "item": [ - { - "id": "b11c7957-c979-4fc6-925d-bad4a7f8b4bb", - "name": "Create Customer[Verify customer creation]", - "request": { - "name": "Create Customer[Verify customer creation]", - "description": { - "content": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"customer_id\": \"CustomerNew1\",\n \"email\": \"guest@example.com\",\n \"name\": \"John Doe\",\n \"phone\": \"999999999\",\n \"phone_country_code\": \"+65\",\n \"description\": \"First customer\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "bf13adb0-1f8c-47af-b728-9b2c976028e8", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/customers - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/customers - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/customers - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resCustomerId = jsonData?.customer_id;\n", - "// Response body should have \"customer_id\"\npm.test(\"[POST]::/customers - Content check if 'customer_id' exists\", function() {\n pm.expect(_resCustomerId !== undefined).to.be.true;\n});\n", - "// Response body should have value \"CustomerNew1\" for \"customer_id\"\nif (_resCustomerId !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'customer_id' matches 'CustomerNew1'\", function() {\n pm.expect(_resCustomerId).to.eql(\"CustomerNew1\");\n})};\n", - "// Set property value as variable\nconst _resName = jsonData?.name;\n", - "// Response body should have \"name\"\npm.test(\"[POST]::/customers - Content check if 'name' exists\", function() {\n pm.expect(_resName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"John Doe\" for \"name\"\nif (_resName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'name' matches 'John Doe'\", function() {\n pm.expect(_resName).to.eql(\"John Doe\");\n})};\n", - "// Set property value as variable\nconst _resPhone = jsonData?.phone;\n", - "// Response body should have \"phone\"\npm.test(\"[POST]::/customers - Content check if 'phone' exists\", function() {\n pm.expect(_resPhone !== undefined).to.be.true;\n});\n", - "// Response body should have value \"999999999\" for \"phone\"\nif (_resPhone !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'phone' matches '999999999'\", function() {\n pm.expect(_resPhone).to.eql(\"999999999\");\n})};\n", - "// Set property value as variable\nconst _resEmail = jsonData?.email;\n", - "// Response body should have \"email\"\npm.test(\"[POST]::/customers - Content check if 'email' exists\", function() {\n pm.expect(_resEmail !== undefined).to.be.true;\n});\n", - "// Response body should have value \"guest@example.com\" for \"email\"\nif (_resEmail !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'email' matches 'guest@example.com'\", function() {\n pm.expect(_resEmail).to.eql(\"guest@example.com\");\n})};\n", - "// Set property value as variable\nconst _resDescription = jsonData?.description;\n", - "// Response body should have \"description\"\npm.test(\"[POST]::/customers - Content check if 'description' exists\", function() {\n pm.expect(_resDescription !== undefined).to.be.true;\n});\n", - "// Response body should have value \"First customer\" for \"description\"\nif (_resDescription !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'description' matches 'First customer'\", function() {\n pm.expect(_resDescription).to.eql(\"First customer\");\n})};\n", - "// Set property value as variable\nconst _resAddressCity = jsonData?.address?.city;\n", - "// Response body should have \"address.city\"\npm.test(\"[POST]::/customers - Content check if 'address.city' exists\", function() {\n pm.expect(_resAddressCity !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Bangalore\" for \"address.city\"\nif (_resAddressCity !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.city' matches 'Bangalore'\", function() {\n pm.expect(_resAddressCity).to.eql(\"Bangalore\");\n})};\n", - "// Set property value as variable\nconst _resAddressCountry = jsonData?.address?.country;\n", - "// Response body should have \"address.country\"\npm.test(\"[POST]::/customers - Content check if 'address.country' exists\", function() {\n pm.expect(_resAddressCountry !== undefined).to.be.true;\n});\n", - "// Response body should have value \"India\" for \"address.country\"\nif (_resAddressCountry !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.country' matches 'India'\", function() {\n pm.expect(_resAddressCountry).to.eql(\"India\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine1 = jsonData?.address?.line1;\n", - "// Response body should have \"address.line1\"\npm.test(\"[POST]::/customers - Content check if 'address.line1' exists\", function() {\n pm.expect(_resAddressLine1 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Juspay router\" for \"address.line1\"\nif (_resAddressLine1 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line1' matches 'Juspay router'\", function() {\n pm.expect(_resAddressLine1).to.eql(\"Juspay router\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine2 = jsonData?.address?.line2;\n", - "// Response body should have \"address.line2\"\npm.test(\"[POST]::/customers - Content check if 'address.line2' exists\", function() {\n pm.expect(_resAddressLine2 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Koramangala\" for \"address.line2\"\nif (_resAddressLine2 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line2' matches 'Koramangala'\", function() {\n pm.expect(_resAddressLine2).to.eql(\"Koramangala\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine3 = jsonData?.address?.line3;\n", - "// Response body should have \"address.line3\"\npm.test(\"[POST]::/customers - Content check if 'address.line3' exists\", function() {\n pm.expect(_resAddressLine3 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Stallion\" for \"address.line3\"\nif (_resAddressLine3 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line3' matches 'Stallion'\", function() {\n pm.expect(_resAddressLine3).to.eql(\"Stallion\");\n})};\n", - "// Set property value as variable\nconst _resAddressState = jsonData?.address?.state;\n", - "// Response body should have \"address.state\"\npm.test(\"[POST]::/customers - Content check if 'address.state' exists\", function() {\n pm.expect(_resAddressState !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Karnataka\" for \"address.state\"\nif (_resAddressState !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.state' matches 'Karnataka'\", function() {\n pm.expect(_resAddressState).to.eql(\"Karnataka\");\n})};\n", - "// Set property value as variable\nconst _resAddressZip = jsonData?.address?.zip;\n", - "// Response body should have \"address.zip\"\npm.test(\"[POST]::/customers - Content check if 'address.zip' exists\", function() {\n pm.expect(_resAddressZip !== undefined).to.be.true;\n});\n", - "// Response body should have value \"560095\" for \"address.zip\"\nif (_resAddressZip !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.zip' matches '560095'\", function() {\n pm.expect(_resAddressZip).to.eql(\"560095\");\n})};\n", - "// Set property value as variable\nconst _resAddressFirstName = jsonData?.address?.first_name;\n", - "// Response body should have \"address.first_name\"\npm.test(\"[POST]::/customers - Content check if 'address.first_name' exists\", function() {\n pm.expect(_resAddressFirstName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"John\" for \"address.first_name\"\nif (_resAddressFirstName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.first_name' matches 'John'\", function() {\n pm.expect(_resAddressFirstName).to.eql(\"John\");\n})};\n", - "// Set property value as variable\nconst _resAddressLastName = jsonData?.address?.last_name;\n", - "// Response body should have \"address.last_name\"\npm.test(\"[POST]::/customers - Content check if 'address.last_name' exists\", function() {\n pm.expect(_resAddressLastName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Doe\" for \"address.last_name\"\nif (_resAddressLastName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.last_name' matches 'Doe'\", function() {\n pm.expect(_resAddressLastName).to.eql(\"Doe\");\n})};\n", - "// Set property value as variable\nconst _resPhoneCountryCode = jsonData?.phone_country_code;\n", - "// Response body should have \"phone_country_code\"\npm.test(\"[POST]::/customers - Content check if 'phone_country_code' exists\", function() {\n pm.expect(_resPhoneCountryCode !== undefined).to.be.true;\n});\n", - "// Response body should have value \"+65\" for \"phone_country_code\"\nif (_resPhoneCountryCode !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'phone_country_code' matches '+65'\", function() {\n pm.expect(_resPhoneCountryCode).to.eql(\"+65\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "6b9dca37-f934-42e8-92de-6436364d2294", - "name": "Retrieve Customer[Verify customer creation]", - "request": { - "name": "Retrieve Customer[Verify customer creation]", - "description": { - "content": "Retrieve a customer's details.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "c6882261-1d82-4ecd-9d69-e1e91f10435c", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/customers/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resCustomerId = jsonData?.customer_id;\n", - "// Response body should have \"customer_id\"\npm.test(\"[GET]::/customers/:id - Content check if 'customer_id' exists\", function() {\n pm.expect(_resCustomerId !== undefined).to.be.true;\n});\n", - "// Response body should have value \"CustomerNew1\" for \"customer_id\"\nif (_resCustomerId !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'customer_id' matches 'CustomerNew1'\", function() {\n pm.expect(_resCustomerId).to.eql(\"CustomerNew1\");\n})};\n", - "// Set property value as variable\nconst _resName = jsonData?.name;\n", - "// Response body should have \"name\"\npm.test(\"[GET]::/customers/:id - Content check if 'name' exists\", function() {\n pm.expect(_resName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"John Doe\" for \"name\"\nif (_resName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'name' matches 'John Doe'\", function() {\n pm.expect(_resName).to.eql(\"John Doe\");\n})};\n", - "// Set property value as variable\nconst _resPhone = jsonData?.phone;\n", - "// Response body should have \"phone\"\npm.test(\"[GET]::/customers/:id - Content check if 'phone' exists\", function() {\n pm.expect(_resPhone !== undefined).to.be.true;\n});\n", - "// Response body should have value \"999999999\" for \"phone\"\nif (_resPhone !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'phone' matches '999999999'\", function() {\n pm.expect(_resPhone).to.eql(\"999999999\");\n})};\n", - "// Set property value as variable\nconst _resEmail = jsonData?.email;\n", - "// Response body should have \"email\"\npm.test(\"[GET]::/customers/:id - Content check if 'email' exists\", function() {\n pm.expect(_resEmail !== undefined).to.be.true;\n});\n", - "// Response body should have value \"guest@example.com\" for \"email\"\nif (_resEmail !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'email' matches 'guest@example.com'\", function() {\n pm.expect(_resEmail).to.eql(\"guest@example.com\");\n})};\n", - "// Set property value as variable\nconst _resDescription = jsonData?.description;\n", - "// Response body should have \"description\"\npm.test(\"[GET]::/customers/:id - Content check if 'description' exists\", function() {\n pm.expect(_resDescription !== undefined).to.be.true;\n});\n", - "// Response body should have value \"First customer\" for \"description\"\nif (_resDescription !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'description' matches 'First customer'\", function() {\n pm.expect(_resDescription).to.eql(\"First customer\");\n})};\n", - "// Set property value as variable\nconst _resAddressCity = jsonData?.address?.city;\n", - "// Response body should have \"address.city\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.city' exists\", function() {\n pm.expect(_resAddressCity !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Bangalore\" for \"address.city\"\nif (_resAddressCity !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.city' matches 'Bangalore'\", function() {\n pm.expect(_resAddressCity).to.eql(\"Bangalore\");\n})};\n", - "// Set property value as variable\nconst _resAddressCountry = jsonData?.address?.country;\n", - "// Response body should have \"address.country\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.country' exists\", function() {\n pm.expect(_resAddressCountry !== undefined).to.be.true;\n});\n", - "// Response body should have value \"India\" for \"address.country\"\nif (_resAddressCountry !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.country' matches 'India'\", function() {\n pm.expect(_resAddressCountry).to.eql(\"India\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine1 = jsonData?.address?.line1;\n", - "// Response body should have \"address.line1\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line1' exists\", function() {\n pm.expect(_resAddressLine1 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Juspay router\" for \"address.line1\"\nif (_resAddressLine1 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line1' matches 'Juspay router'\", function() {\n pm.expect(_resAddressLine1).to.eql(\"Juspay router\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine2 = jsonData?.address?.line2;\n", - "// Response body should have \"address.line2\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line2' exists\", function() {\n pm.expect(_resAddressLine2 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Koramangala\" for \"address.line2\"\nif (_resAddressLine2 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line2' matches 'Koramangala'\", function() {\n pm.expect(_resAddressLine2).to.eql(\"Koramangala\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine3 = jsonData?.address?.line3;\n", - "// Response body should have \"address.line3\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line3' exists\", function() {\n pm.expect(_resAddressLine3 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Stallion\" for \"address.line3\"\nif (_resAddressLine3 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line3' matches 'Stallion'\", function() {\n pm.expect(_resAddressLine3).to.eql(\"Stallion\");\n})};\n", - "// Set property value as variable\nconst _resAddressState = jsonData?.address?.state;\n", - "// Response body should have \"address.state\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.state' exists\", function() {\n pm.expect(_resAddressState !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Karnataka\" for \"address.state\"\nif (_resAddressState !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.state' matches 'Karnataka'\", function() {\n pm.expect(_resAddressState).to.eql(\"Karnataka\");\n})};\n", - "// Set property value as variable\nconst _resAddressZip = jsonData?.address?.zip;\n", - "// Response body should have \"address.zip\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.zip' exists\", function() {\n pm.expect(_resAddressZip !== undefined).to.be.true;\n});\n", - "// Response body should have value \"560095\" for \"address.zip\"\nif (_resAddressZip !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.zip' matches '560095'\", function() {\n pm.expect(_resAddressZip).to.eql(\"560095\");\n})};\n", - "// Set property value as variable\nconst _resAddressFirstName = jsonData?.address?.first_name;\n", - "// Response body should have \"address.first_name\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.first_name' exists\", function() {\n pm.expect(_resAddressFirstName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"John\" for \"address.first_name\"\nif (_resAddressFirstName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.first_name' matches 'John'\", function() {\n pm.expect(_resAddressFirstName).to.eql(\"John\");\n})};\n", - "// Set property value as variable\nconst _resAddressLastName = jsonData?.address?.last_name;\n", - "// Response body should have \"address.last_name\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.last_name' exists\", function() {\n pm.expect(_resAddressLastName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Doe\" for \"address.last_name\"\nif (_resAddressLastName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.last_name' matches 'Doe'\", function() {\n pm.expect(_resAddressLastName).to.eql(\"Doe\");\n})};\n", - "// Set property value as variable\nconst _resPhoneCountryCode = jsonData?.phone_country_code;\n", - "// Response body should have \"phone_country_code\"\npm.test(\"[GET]::/customers/:id - Content check if 'phone_country_code' exists\", function() {\n pm.expect(_resPhoneCountryCode !== undefined).to.be.true;\n});\n", - "// Response body should have value \"+65\" for \"phone_country_code\"\nif (_resPhoneCountryCode !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'phone_country_code' matches '+65'\", function() {\n pm.expect(_resPhoneCountryCode).to.eql(\"+65\");\n})};\n" - ] - } - } - ] - }, - { - "id": "1e12405d-2ba6-4b2c-b896-df432b352adf", - "name": "Update Customer[update customer details]", - "request": { - "name": "Update Customer[update customer details]", - "description": { - "content": "Updates the customer's details in a customer object.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"email\": \"joseph@example.com\",\n \"name\": \"Joseph\",\n \"phone_country_code\": \"+91\",\n \"phone\": \"8888888888\",\n \"address\": {\n \"line1\": \"123\",\n \"line2\": \"cg custom street\",\n \"line3\": \"Stallion\",\n \"city\": \"chennai\",\n \"state\": \"Tamilnadu\",\n \"zip\": \"620021\",\n \"country\": \"IN\",\n \"first_name\": \"joseph\",\n \"last_name\": \"Doe\"\n },\n \"description\": \"Test customer\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "6cdc9d26-4ede-410a-bcb7-99094baea6e0", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/customers/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resCustomerId = jsonData?.customer_id;\n", - "// Response body should have \"customer_id\"\npm.test(\"[POST]::/customers/:id - Content check if 'customer_id' exists\", function() {\n pm.expect(_resCustomerId !== undefined).to.be.true;\n});\n", - "// Response body should have value \"CustomerNew1\" for \"customer_id\"\nif (_resCustomerId !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'customer_id' matches 'CustomerNew1'\", function() {\n pm.expect(_resCustomerId).to.eql(\"CustomerNew1\");\n})};\n", - "// Set property value as variable\nconst _resName = jsonData?.name;\n", - "// Response body should have \"name\"\npm.test(\"[POST]::/customers/:id - Content check if 'name' exists\", function() {\n pm.expect(_resName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Joseph\" for \"name\"\nif (_resName !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'name' matches 'Joseph'\", function() {\n pm.expect(_resName).to.eql(\"Joseph\");\n})};\n", - "// Set property value as variable\nconst _resPhone = jsonData?.phone;\n", - "// Response body should have \"phone\"\npm.test(\"[POST]::/customers/:id - Content check if 'phone' exists\", function() {\n pm.expect(_resPhone !== undefined).to.be.true;\n});\n", - "// Response body should have value \"8888888888\" for \"phone\"\nif (_resPhone !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'phone' matches '8888888888'\", function() {\n pm.expect(_resPhone).to.eql(\"8888888888\");\n})};\n", - "// Set property value as variable\nconst _resEmail = jsonData?.email;\n", - "// Response body should have \"email\"\npm.test(\"[POST]::/customers/:id - Content check if 'email' exists\", function() {\n pm.expect(_resEmail !== undefined).to.be.true;\n});\n", - "// Response body should have value \"joseph@example.com\" for \"email\"\nif (_resEmail !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'email' matches 'joseph@example.com'\", function() {\n pm.expect(_resEmail).to.eql(\"joseph@example.com\");\n})};\n", - "// Set property value as variable\nconst _resDescription = jsonData?.description;\n", - "// Response body should have \"description\"\npm.test(\"[POST]::/customers/:id - Content check if 'description' exists\", function() {\n pm.expect(_resDescription !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Test customer\" for \"description\"\nif (_resDescription !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'description' matches 'Test customer'\", function() {\n pm.expect(_resDescription).to.eql(\"Test customer\");\n})};\n", - "// Set property value as variable\nconst _resAddressCity = jsonData?.address?.city;\n", - "// Response body should have \"address.city\"\npm.test(\"[POST]::/customers/:id - Content check if 'address.city' exists\", function() {\n pm.expect(_resAddressCity !== undefined).to.be.true;\n});\n", - "// Response body should have value \"chennai\" for \"address.city\"\nif (_resAddressCity !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'address.city' matches 'chennai'\", function() {\n pm.expect(_resAddressCity).to.eql(\"chennai\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine1 = jsonData?.address?.line1;\n", - "// Response body should have \"address.line1\"\npm.test(\"[POST]::/customers/:id - Content check if 'address.line1' exists\", function() {\n pm.expect(_resAddressLine1 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"123\" for \"address.line1\"\nif (_resAddressLine1 !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'address.line1' matches '123'\", function() {\n pm.expect(_resAddressLine1).to.eql(\"123\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine2 = jsonData?.address?.line2;\n", - "// Response body should have \"address.line2\"\npm.test(\"[POST]::/customers/:id - Content check if 'address.line2' exists\", function() {\n pm.expect(_resAddressLine2 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"cg custom street\" for \"address.line2\"\nif (_resAddressLine2 !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'address.line2' matches 'cg custom street'\", function() {\n pm.expect(_resAddressLine2).to.eql(\"cg custom street\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine3 = jsonData?.address?.line3;\n", - "// Response body should have \"address.line3\"\npm.test(\"[POST]::/customers/:id - Content check if 'address.line3' exists\", function() {\n pm.expect(_resAddressLine3 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Stallion\" for \"address.line3\"\nif (_resAddressLine3 !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'address.line3' matches 'Stallion'\", function() {\n pm.expect(_resAddressLine3).to.eql(\"Stallion\");\n})};\n", - "// Set property value as variable\nconst _resAddressState = jsonData?.address?.state;\n", - "// Response body should have \"address.state\"\npm.test(\"[POST]::/customers/:id - Content check if 'address.state' exists\", function() {\n pm.expect(_resAddressState !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Tamilnadu\" for \"address.state\"\nif (_resAddressState !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'address.state' matches 'Tamilnadu'\", function() {\n pm.expect(_resAddressState).to.eql(\"Tamilnadu\");\n})};\n", - "// Set property value as variable\nconst _resAddressZip = jsonData?.address?.zip;\n", - "// Response body should have \"address.zip\"\npm.test(\"[POST]::/customers/:id - Content check if 'address.zip' exists\", function() {\n pm.expect(_resAddressZip !== undefined).to.be.true;\n});\n", - "// Response body should have value \"620021\" for \"address.zip\"\nif (_resAddressZip !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'address.zip' matches '620021'\", function() {\n pm.expect(_resAddressZip).to.eql(\"620021\");\n})};\n", - "// Set property value as variable\nconst _resAddressFirstName = jsonData?.address?.first_name;\n", - "// Response body should have \"address.first_name\"\npm.test(\"[POST]::/customers/:id - Content check if 'address.first_name' exists\", function() {\n pm.expect(_resAddressFirstName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"joseph\" for \"address.first_name\"\nif (_resAddressFirstName !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'address.first_name' matches 'joseph'\", function() {\n pm.expect(_resAddressFirstName).to.eql(\"joseph\");\n})};\n", - "// Set property value as variable\nconst _resAddressLastName = jsonData?.address?.last_name;\n", - "// Response body should have \"address.last_name\"\npm.test(\"[POST]::/customers/:id - Content check if 'address.last_name' exists\", function() {\n pm.expect(_resAddressLastName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Doe\" for \"address.last_name\"\nif (_resAddressLastName !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'address.last_name' matches 'Doe'\", function() {\n pm.expect(_resAddressLastName).to.eql(\"Doe\");\n})};\n", - "// Set property value as variable\nconst _resPhoneCountryCode = jsonData?.phone_country_code;\n", - "// Response body should have \"phone_country_code\"\npm.test(\"[POST]::/customers/:id - Content check if 'phone_country_code' exists\", function() {\n pm.expect(_resPhoneCountryCode !== undefined).to.be.true;\n});\n", - "// Response body should have value \"+91\" for \"phone_country_code\"\nif (_resPhoneCountryCode !== undefined) {\npm.test(\"[POST]::/customers/:id - Content check if value for 'phone_country_code' matches '+91'\", function() {\n pm.expect(_resPhoneCountryCode).to.eql(\"+91\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "3d80f15f-5a26-4f20-85ce-bd57bfbf9ac9", - "name": "Retrieve Customer[retrieve updated customer]", - "request": { - "name": "Retrieve Customer[retrieve updated customer]", - "description": { - "content": "Retrieve a customer's details.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "5d944f46-b182-4794-96c9-9ac96b4b459a", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/customers/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resCustomerId = jsonData?.customer_id;\n", - "// Response body should have \"customer_id\"\npm.test(\"[GET]::/customers/:id - Content check if 'customer_id' exists\", function() {\n pm.expect(_resCustomerId !== undefined).to.be.true;\n});\n", - "// Response body should have value \"CustomerNew1\" for \"customer_id\"\nif (_resCustomerId !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'customer_id' matches 'CustomerNew1'\", function() {\n pm.expect(_resCustomerId).to.eql(\"CustomerNew1\");\n})};\n", - "// Set property value as variable\nconst _resName = jsonData?.name;\n", - "// Response body should have \"name\"\npm.test(\"[GET]::/customers/:id - Content check if 'name' exists\", function() {\n pm.expect(_resName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Joseph\" for \"name\"\nif (_resName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'name' matches 'Joseph'\", function() {\n pm.expect(_resName).to.eql(\"Joseph\");\n})};\n", - "// Set property value as variable\nconst _resPhone = jsonData?.phone;\n", - "// Response body should have \"phone\"\npm.test(\"[GET]::/customers/:id - Content check if 'phone' exists\", function() {\n pm.expect(_resPhone !== undefined).to.be.true;\n});\n", - "// Response body should have value \"8888888888\" for \"phone\"\nif (_resPhone !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'phone' matches '8888888888'\", function() {\n pm.expect(_resPhone).to.eql(\"8888888888\");\n})};\n", - "// Set property value as variable\nconst _resEmail = jsonData?.email;\n", - "// Response body should have \"email\"\npm.test(\"[GET]::/customers/:id - Content check if 'email' exists\", function() {\n pm.expect(_resEmail !== undefined).to.be.true;\n});\n", - "// Response body should have value \"joseph@example.com\" for \"email\"\nif (_resEmail !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'email' matches 'joseph@example.com'\", function() {\n pm.expect(_resEmail).to.eql(\"joseph@example.com\");\n})};\n", - "// Set property value as variable\nconst _resDescription = jsonData?.description;\n", - "// Response body should have \"description\"\npm.test(\"[GET]::/customers/:id - Content check if 'description' exists\", function() {\n pm.expect(_resDescription !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Test customer\" for \"description\"\nif (_resDescription !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'description' matches 'Test customer'\", function() {\n pm.expect(_resDescription).to.eql(\"Test customer\");\n})};\n", - "// Set property value as variable\nconst _resAddressCity = jsonData?.address?.city;\n", - "// Response body should have \"address.city\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.city' exists\", function() {\n pm.expect(_resAddressCity !== undefined).to.be.true;\n});\n", - "// Response body should have value \"chennai\" for \"address.city\"\nif (_resAddressCity !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.city' matches 'chennai'\", function() {\n pm.expect(_resAddressCity).to.eql(\"chennai\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine1 = jsonData?.address?.line1;\n", - "// Response body should have \"address.line1\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line1' exists\", function() {\n pm.expect(_resAddressLine1 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"123\" for \"address.line1\"\nif (_resAddressLine1 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line1' matches '123'\", function() {\n pm.expect(_resAddressLine1).to.eql(\"123\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine2 = jsonData?.address?.line2;\n", - "// Response body should have \"address.line2\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line2' exists\", function() {\n pm.expect(_resAddressLine2 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"cg custom street\" for \"address.line2\"\nif (_resAddressLine2 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line2' matches 'cg custom street'\", function() {\n pm.expect(_resAddressLine2).to.eql(\"cg custom street\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine3 = jsonData?.address?.line3;\n", - "// Response body should have \"address.line3\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line3' exists\", function() {\n pm.expect(_resAddressLine3 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Stallion\" for \"address.line3\"\nif (_resAddressLine3 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line3' matches 'Stallion'\", function() {\n pm.expect(_resAddressLine3).to.eql(\"Stallion\");\n})};\n", - "// Set property value as variable\nconst _resAddressState = jsonData?.address?.state;\n", - "// Response body should have \"address.state\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.state' exists\", function() {\n pm.expect(_resAddressState !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Tamilnadu\" for \"address.state\"\nif (_resAddressState !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.state' matches 'Tamilnadu'\", function() {\n pm.expect(_resAddressState).to.eql(\"Tamilnadu\");\n})};\n", - "// Set property value as variable\nconst _resAddressZip = jsonData?.address?.zip;\n", - "// Response body should have \"address.zip\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.zip' exists\", function() {\n pm.expect(_resAddressZip !== undefined).to.be.true;\n});\n", - "// Response body should have value \"620021\" for \"address.zip\"\nif (_resAddressZip !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.zip' matches '620021'\", function() {\n pm.expect(_resAddressZip).to.eql(\"620021\");\n})};\n", - "// Set property value as variable\nconst _resAddressFirstName = jsonData?.address?.first_name;\n", - "// Response body should have \"address.first_name\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.first_name' exists\", function() {\n pm.expect(_resAddressFirstName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"joseph\" for \"address.first_name\"\nif (_resAddressFirstName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.first_name' matches 'joseph'\", function() {\n pm.expect(_resAddressFirstName).to.eql(\"joseph\");\n})};\n", - "// Set property value as variable\nconst _resAddressLastName = jsonData?.address?.last_name;\n", - "// Response body should have \"address.last_name\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.last_name' exists\", function() {\n pm.expect(_resAddressLastName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Doe\" for \"address.last_name\"\nif (_resAddressLastName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.last_name' matches 'Doe'\", function() {\n pm.expect(_resAddressLastName).to.eql(\"Doe\");\n})};\n", - "// Set property value as variable\nconst _resPhoneCountryCode = jsonData?.phone_country_code;\n", - "// Response body should have \"phone_country_code\"\npm.test(\"[GET]::/customers/:id - Content check if 'phone_country_code' exists\", function() {\n pm.expect(_resPhoneCountryCode !== undefined).to.be.true;\n});\n", - "// Response body should have value \"+91\" for \"phone_country_code\"\nif (_resPhoneCountryCode !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'phone_country_code' matches '+91'\", function() {\n pm.expect(_resPhoneCountryCode).to.eql(\"+91\");\n})};\n" - ] - } - } - ] - }, - { - "id": "f12115d2-20a8-4dd9-812d-c22c397bd1d5", - "name": "Delete Customer[Delete customer]", - "request": { - "name": "Delete Customer[Delete customer]", - "description": { - "content": "Delete a customer record.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "DELETE" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "4ee8d222-67f5-4587-b6a5-58e3ee66d96e", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[DELETE]::/customers/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[DELETE]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\",\"deleted\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"deleted\":{\"type\":\"boolean\",\"description\":\"Indicates the deletion status of the customer object.\",\"example\":true}}}\n\n// Validate if response matches JSON schema \npm.test(\"[DELETE]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resDeleted = jsonData?.deleted;\n", - "// Response body should have \"deleted\"\npm.test(\"[DELETE]::/customers/:id - Content check if 'deleted' exists\", function() {\n pm.expect(_resDeleted !== undefined).to.be.true;\n});\n", - "// Response body should have value \"true\" for \"deleted\"\nif (_resDeleted !== undefined) {\npm.test(\"[DELETE]::/customers/:id - Content check if value for 'deleted' matches 'true'\", function() {\n pm.expect(_resDeleted).to.eql(\"true\");\n})};\n" - ] - } - } - ] - }, - { - "id": "6e889739-11bc-4a0e-b345-09a8565ce7ca", - "name": "Delete Customer[Delete Customer with invalid Id]", - "request": { - "name": "Delete Customer[Delete Customer with invalid Id]", - "description": { - "content": "Delete a customer record.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "DELETE" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "c25ed436-60ae-4c4c-be96-4740972f04b5", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[DELETE]::/customers/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[DELETE]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\",\"deleted\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"deleted\":{\"type\":\"boolean\",\"description\":\"Indicates the deletion status of the customer object.\",\"example\":true}}}\n\n// Validate if response matches JSON schema \npm.test(\"[DELETE]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[DELETE]::/customers/:id - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"No such customer exist: CustomerNew1\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[DELETE]::/customers/:id - Content check if value for 'message' matches 'No such customer exist: CustomerNew1'\", function() {\n pm.expect(_resMessage).to.eql(\"No such customer exist: CustomerNew1\");\n})};\n" - ] - } - } - ] - }, - { - "id": "56bc3523-929e-4e9f-a69a-e4aac8946669", - "name": "Create Customer[Create Customer without CID]", - "request": { - "name": "Create Customer[Create Customer without CID]", - "description": { - "content": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"email\": \"guest@example.com\",\n \"name\": \"John Doe\",\n \"phone\": \"999999999\",\n \"phone_country_code\": \"+65\",\n \"description\": \"First customer\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "208280d6-0ecc-491b-b645-95c4d39313e4", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/customers - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/customers - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/customers - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resCustomerId = jsonData?.customer_id;\n", - "// Response body should have \"customer_id\"\npm.test(\"[POST]::/customers - Content check if 'customer_id' exists\", function() {\n pm.expect(_resCustomerId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"1\" for \"customer_id\"\nif (_resCustomerId !== undefined) {\npm.test(\"[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'\", function() {\n pm.expect(jsonData.customer_id.length).is.at.least(1);\n})};\n", - "// Set property value as variable\nconst _resName = jsonData?.name;\n", - "// Response body should have \"name\"\npm.test(\"[POST]::/customers - Content check if 'name' exists\", function() {\n pm.expect(_resName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"John Doe\" for \"name\"\nif (_resName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'name' matches 'John Doe'\", function() {\n pm.expect(_resName).to.eql(\"John Doe\");\n})};\n", - "// Set property value as variable\nconst _resPhone = jsonData?.phone;\n", - "// Response body should have \"phone\"\npm.test(\"[POST]::/customers - Content check if 'phone' exists\", function() {\n pm.expect(_resPhone !== undefined).to.be.true;\n});\n", - "// Response body should have value \"999999999\" for \"phone\"\nif (_resPhone !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'phone' matches '999999999'\", function() {\n pm.expect(_resPhone).to.eql(\"999999999\");\n})};\n", - "// Set property value as variable\nconst _resEmail = jsonData?.email;\n", - "// Response body should have \"email\"\npm.test(\"[POST]::/customers - Content check if 'email' exists\", function() {\n pm.expect(_resEmail !== undefined).to.be.true;\n});\n", - "// Response body should have value \"guest@example.com\" for \"email\"\nif (_resEmail !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'email' matches 'guest@example.com'\", function() {\n pm.expect(_resEmail).to.eql(\"guest@example.com\");\n})};\n", - "// Set property value as variable\nconst _resDescription = jsonData?.description;\n", - "// Response body should have \"description\"\npm.test(\"[POST]::/customers - Content check if 'description' exists\", function() {\n pm.expect(_resDescription !== undefined).to.be.true;\n});\n", - "// Response body should have value \"First customer\" for \"description\"\nif (_resDescription !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'description' matches 'First customer'\", function() {\n pm.expect(_resDescription).to.eql(\"First customer\");\n})};\n", - "// Set property value as variable\nconst _resAddressCity = jsonData?.address?.city;\n", - "// Response body should have \"address.city\"\npm.test(\"[POST]::/customers - Content check if 'address.city' exists\", function() {\n pm.expect(_resAddressCity !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Bangalore\" for \"address.city\"\nif (_resAddressCity !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.city' matches 'Bangalore'\", function() {\n pm.expect(_resAddressCity).to.eql(\"Bangalore\");\n})};\n", - "// Set property value as variable\nconst _resAddressCountry = jsonData?.address?.country;\n", - "// Response body should have \"address.country\"\npm.test(\"[POST]::/customers - Content check if 'address.country' exists\", function() {\n pm.expect(_resAddressCountry !== undefined).to.be.true;\n});\n", - "// Response body should have value \"India\" for \"address.country\"\nif (_resAddressCountry !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.country' matches 'India'\", function() {\n pm.expect(_resAddressCountry).to.eql(\"India\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine1 = jsonData?.address?.line1;\n", - "// Response body should have \"address.line1\"\npm.test(\"[POST]::/customers - Content check if 'address.line1' exists\", function() {\n pm.expect(_resAddressLine1 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Juspay router\" for \"address.line1\"\nif (_resAddressLine1 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line1' matches 'Juspay router'\", function() {\n pm.expect(_resAddressLine1).to.eql(\"Juspay router\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine2 = jsonData?.address?.line2;\n", - "// Response body should have \"address.line2\"\npm.test(\"[POST]::/customers - Content check if 'address.line2' exists\", function() {\n pm.expect(_resAddressLine2 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Koramangala\" for \"address.line2\"\nif (_resAddressLine2 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line2' matches 'Koramangala'\", function() {\n pm.expect(_resAddressLine2).to.eql(\"Koramangala\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine3 = jsonData?.address?.line3;\n", - "// Response body should have \"address.line3\"\npm.test(\"[POST]::/customers - Content check if 'address.line3' exists\", function() {\n pm.expect(_resAddressLine3 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Stallion\" for \"address.line3\"\nif (_resAddressLine3 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line3' matches 'Stallion'\", function() {\n pm.expect(_resAddressLine3).to.eql(\"Stallion\");\n})};\n", - "// Set property value as variable\nconst _resAddressState = jsonData?.address?.state;\n", - "// Response body should have \"address.state\"\npm.test(\"[POST]::/customers - Content check if 'address.state' exists\", function() {\n pm.expect(_resAddressState !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Karnataka\" for \"address.state\"\nif (_resAddressState !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.state' matches 'Karnataka'\", function() {\n pm.expect(_resAddressState).to.eql(\"Karnataka\");\n})};\n", - "// Set property value as variable\nconst _resAddressZip = jsonData?.address?.zip;\n", - "// Response body should have \"address.zip\"\npm.test(\"[POST]::/customers - Content check if 'address.zip' exists\", function() {\n pm.expect(_resAddressZip !== undefined).to.be.true;\n});\n", - "// Response body should have value \"560095\" for \"address.zip\"\nif (_resAddressZip !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.zip' matches '560095'\", function() {\n pm.expect(_resAddressZip).to.eql(\"560095\");\n})};\n", - "// Set property value as variable\nconst _resAddressFirstName = jsonData?.address?.first_name;\n", - "// Response body should have \"address.first_name\"\npm.test(\"[POST]::/customers - Content check if 'address.first_name' exists\", function() {\n pm.expect(_resAddressFirstName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"John\" for \"address.first_name\"\nif (_resAddressFirstName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.first_name' matches 'John'\", function() {\n pm.expect(_resAddressFirstName).to.eql(\"John\");\n})};\n", - "// Set property value as variable\nconst _resAddressLastName = jsonData?.address?.last_name;\n", - "// Response body should have \"address.last_name\"\npm.test(\"[POST]::/customers - Content check if 'address.last_name' exists\", function() {\n pm.expect(_resAddressLastName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Doe\" for \"address.last_name\"\nif (_resAddressLastName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.last_name' matches 'Doe'\", function() {\n pm.expect(_resAddressLastName).to.eql(\"Doe\");\n})};\n", - "// Set property value as variable\nconst _resPhoneCountryCode = jsonData?.phone_country_code;\n", - "// Response body should have \"phone_country_code\"\npm.test(\"[POST]::/customers - Content check if 'phone_country_code' exists\", function() {\n pm.expect(_resPhoneCountryCode !== undefined).to.be.true;\n});\n", - "// Response body should have value \"+65\" for \"phone_country_code\"\nif (_resPhoneCountryCode !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'phone_country_code' matches '+65'\", function() {\n pm.expect(_resPhoneCountryCode).to.eql(\"+65\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "c38e91e5-1bc9-4778-9f03-5d21c90b7626", - "name": "Create Customer[Create Customer without any details]", - "request": { - "name": "Create Customer[Create Customer without any details]", - "description": { - "content": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "e8b5795f-83dd-40b9-ada4-5e9b152b1626", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/customers - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/customers - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/customers - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resCustomerId = jsonData?.customer_id;\n", - "// Response body should have \"customer_id\"\npm.test(\"[POST]::/customers - Content check if 'customer_id' exists\", function() {\n pm.expect(_resCustomerId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"1\" for \"customer_id\"\nif (_resCustomerId !== undefined) {\npm.test(\"[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'\", function() {\n pm.expect(jsonData.customer_id.length).is.at.least(1);\n})};\n", - "// Set property value as variable\nconst _resName = jsonData?.name;\n", - "// Response body should have \"name\"\npm.test(\"[POST]::/customers - Content check if 'name' exists\", function() {\n pm.expect(_resName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"name\"\nif (_resName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'name' matches 'NULL'\", function() {\n pm.expect(_resName).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resPhone = jsonData?.phone;\n", - "// Response body should have \"phone\"\npm.test(\"[POST]::/customers - Content check if 'phone' exists\", function() {\n pm.expect(_resPhone !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"phone\"\nif (_resPhone !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'phone' matches 'NULL'\", function() {\n pm.expect(_resPhone).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resEmail = jsonData?.email;\n", - "// Response body should have \"email\"\npm.test(\"[POST]::/customers - Content check if 'email' exists\", function() {\n pm.expect(_resEmail !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"email\"\nif (_resEmail !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'email' matches 'NULL'\", function() {\n pm.expect(_resEmail).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resDescription = jsonData?.description;\n", - "// Response body should have \"description\"\npm.test(\"[POST]::/customers - Content check if 'description' exists\", function() {\n pm.expect(_resDescription !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"description\"\nif (_resDescription !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'description' matches 'NULL'\", function() {\n pm.expect(_resDescription).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressCity = jsonData?.address?.city;\n", - "// Response body should have \"address.city\"\npm.test(\"[POST]::/customers - Content check if 'address.city' exists\", function() {\n pm.expect(_resAddressCity !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.city\"\nif (_resAddressCity !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.city' matches 'NULL'\", function() {\n pm.expect(_resAddressCity).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressCountry = jsonData?.address?.country;\n", - "// Response body should have \"address.country\"\npm.test(\"[POST]::/customers - Content check if 'address.country' exists\", function() {\n pm.expect(_resAddressCountry !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.country\"\nif (_resAddressCountry !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.country' matches 'NULL'\", function() {\n pm.expect(_resAddressCountry).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine1 = jsonData?.address?.line1;\n", - "// Response body should have \"address.line1\"\npm.test(\"[POST]::/customers - Content check if 'address.line1' exists\", function() {\n pm.expect(_resAddressLine1 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.line1\"\nif (_resAddressLine1 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line1' matches 'NULL'\", function() {\n pm.expect(_resAddressLine1).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine2 = jsonData?.address?.line2;\n", - "// Response body should have \"address.line2\"\npm.test(\"[POST]::/customers - Content check if 'address.line2' exists\", function() {\n pm.expect(_resAddressLine2 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.line2\"\nif (_resAddressLine2 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line2' matches 'NULL'\", function() {\n pm.expect(_resAddressLine2).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine3 = jsonData?.address?.line3;\n", - "// Response body should have \"address.line3\"\npm.test(\"[POST]::/customers - Content check if 'address.line3' exists\", function() {\n pm.expect(_resAddressLine3 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.line3\"\nif (_resAddressLine3 !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.line3' matches 'NULL'\", function() {\n pm.expect(_resAddressLine3).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressState = jsonData?.address?.state;\n", - "// Response body should have \"address.state\"\npm.test(\"[POST]::/customers - Content check if 'address.state' exists\", function() {\n pm.expect(_resAddressState !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.state\"\nif (_resAddressState !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.state' matches 'NULL'\", function() {\n pm.expect(_resAddressState).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressZip = jsonData?.address?.zip;\n", - "// Response body should have \"address.zip\"\npm.test(\"[POST]::/customers - Content check if 'address.zip' exists\", function() {\n pm.expect(_resAddressZip !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.zip\"\nif (_resAddressZip !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.zip' matches 'NULL'\", function() {\n pm.expect(_resAddressZip).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressFirstName = jsonData?.address?.first_name;\n", - "// Response body should have \"address.first_name\"\npm.test(\"[POST]::/customers - Content check if 'address.first_name' exists\", function() {\n pm.expect(_resAddressFirstName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.first_name\"\nif (_resAddressFirstName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.first_name' matches 'NULL'\", function() {\n pm.expect(_resAddressFirstName).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressLastName = jsonData?.address?.last_name;\n", - "// Response body should have \"address.last_name\"\npm.test(\"[POST]::/customers - Content check if 'address.last_name' exists\", function() {\n pm.expect(_resAddressLastName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.last_name\"\nif (_resAddressLastName !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'address.last_name' matches 'NULL'\", function() {\n pm.expect(_resAddressLastName).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resPhoneCountryCode = jsonData?.phone_country_code;\n", - "// Response body should have \"phone_country_code\"\npm.test(\"[POST]::/customers - Content check if 'phone_country_code' exists\", function() {\n pm.expect(_resPhoneCountryCode !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"phone_country_code\"\nif (_resPhoneCountryCode !== undefined) {\npm.test(\"[POST]::/customers - Content check if value for 'phone_country_code' matches 'NULL'\", function() {\n pm.expect(_resPhoneCountryCode).to.eql(\"NULL\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "7621ff38-a144-4eb8-af3f-8fa82a642561", - "name": "Retrieve Customer[retrieve Customer without any details]", - "request": { - "name": "Retrieve Customer[retrieve Customer without any details]", - "description": { - "content": "Retrieve a customer's details.", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique customer id", - "type": "text/plain" - }, - "type": "string", - "value": "{{customer_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "60446a31-0360-454b-904d-99151a16f2a7", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/customers/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/customers/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Customer\",\"required\":[\"customer_id\"],\"properties\":{\"customer_id\":{\"type\":\"string\",\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":\"string\",\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":\"string\",\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone_country_code\":{\"type\":\"object\",\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":65},\"phone\":{\"type\":\"object\",\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"address\":{\"type\":\"object\",\"description\":\"The address for the customer\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"description\":{\"type\":\"object\",\"description\":\"An arbitrary string that you can attach to a customer object.\",\"maxLength\":255,\"example\":\"First customer\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/customers/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resCustomerId = jsonData?.customer_id;\n", - "// Response body should have \"customer_id\"\npm.test(\"[GET]::/customers/:id - Content check if 'customer_id' exists\", function() {\n pm.expect(_resCustomerId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"1\" for \"customer_id\"\nif (_resCustomerId !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value of 'customer_id' has a minimum length of '1'\", function() {\n pm.expect(jsonData.customer_id.length).is.at.least(1);\n})};\n", - "// Set property value as variable\nconst _resName = jsonData?.name;\n", - "// Response body should have \"name\"\npm.test(\"[GET]::/customers/:id - Content check if 'name' exists\", function() {\n pm.expect(_resName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"name\"\nif (_resName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'name' matches 'NULL'\", function() {\n pm.expect(_resName).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resPhone = jsonData?.phone;\n", - "// Response body should have \"phone\"\npm.test(\"[GET]::/customers/:id - Content check if 'phone' exists\", function() {\n pm.expect(_resPhone !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"phone\"\nif (_resPhone !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'phone' matches 'NULL'\", function() {\n pm.expect(_resPhone).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resEmail = jsonData?.email;\n", - "// Response body should have \"email\"\npm.test(\"[GET]::/customers/:id - Content check if 'email' exists\", function() {\n pm.expect(_resEmail !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"email\"\nif (_resEmail !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'email' matches 'NULL'\", function() {\n pm.expect(_resEmail).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resDescription = jsonData?.description;\n", - "// Response body should have \"description\"\npm.test(\"[GET]::/customers/:id - Content check if 'description' exists\", function() {\n pm.expect(_resDescription !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"description\"\nif (_resDescription !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'description' matches 'NULL'\", function() {\n pm.expect(_resDescription).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressCity = jsonData?.address?.city;\n", - "// Response body should have \"address.city\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.city' exists\", function() {\n pm.expect(_resAddressCity !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.city\"\nif (_resAddressCity !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.city' matches 'NULL'\", function() {\n pm.expect(_resAddressCity).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressCountry = jsonData?.address?.country;\n", - "// Response body should have \"address.country\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.country' exists\", function() {\n pm.expect(_resAddressCountry !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.country\"\nif (_resAddressCountry !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.country' matches 'NULL'\", function() {\n pm.expect(_resAddressCountry).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine1 = jsonData?.address?.line1;\n", - "// Response body should have \"address.line1\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line1' exists\", function() {\n pm.expect(_resAddressLine1 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.line1\"\nif (_resAddressLine1 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line1' matches 'NULL'\", function() {\n pm.expect(_resAddressLine1).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine2 = jsonData?.address?.line2;\n", - "// Response body should have \"address.line2\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line2' exists\", function() {\n pm.expect(_resAddressLine2 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.line2\"\nif (_resAddressLine2 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line2' matches 'NULL'\", function() {\n pm.expect(_resAddressLine2).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressLine3 = jsonData?.address?.line3;\n", - "// Response body should have \"address.line3\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.line3' exists\", function() {\n pm.expect(_resAddressLine3 !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.line3\"\nif (_resAddressLine3 !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.line3' matches 'NULL'\", function() {\n pm.expect(_resAddressLine3).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressState = jsonData?.address?.state;\n", - "// Response body should have \"address.state\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.state' exists\", function() {\n pm.expect(_resAddressState !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.state\"\nif (_resAddressState !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.state' matches 'NULL'\", function() {\n pm.expect(_resAddressState).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressZip = jsonData?.address?.zip;\n", - "// Response body should have \"address.zip\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.zip' exists\", function() {\n pm.expect(_resAddressZip !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.zip\"\nif (_resAddressZip !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.zip' matches 'NULL'\", function() {\n pm.expect(_resAddressZip).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressFirstName = jsonData?.address?.first_name;\n", - "// Response body should have \"address.first_name\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.first_name' exists\", function() {\n pm.expect(_resAddressFirstName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.first_name\"\nif (_resAddressFirstName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.first_name' matches 'NULL'\", function() {\n pm.expect(_resAddressFirstName).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resAddressLastName = jsonData?.address?.last_name;\n", - "// Response body should have \"address.last_name\"\npm.test(\"[GET]::/customers/:id - Content check if 'address.last_name' exists\", function() {\n pm.expect(_resAddressLastName !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"address.last_name\"\nif (_resAddressLastName !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'address.last_name' matches 'NULL'\", function() {\n pm.expect(_resAddressLastName).to.eql(\"NULL\");\n})};\n", - "// Set property value as variable\nconst _resPhoneCountryCode = jsonData?.phone_country_code;\n", - "// Response body should have \"phone_country_code\"\npm.test(\"[GET]::/customers/:id - Content check if 'phone_country_code' exists\", function() {\n pm.expect(_resPhoneCountryCode !== undefined).to.be.true;\n});\n", - "// Response body should have value \"NULL\" for \"phone_country_code\"\nif (_resPhoneCountryCode !== undefined) {\npm.test(\"[GET]::/customers/:id - Content check if value for 'phone_country_code' matches 'NULL'\", function() {\n pm.expect(_resPhoneCountryCode).to.eql(\"NULL\");\n})};\n" - ] - } - } - ] - } - ], - "event": [] - }, - { - "id": "972e10d9-5ee2-4255-afbd-35f3b985e2f8", - "name": "QuickStart Variations", - "item": [ - { - "id": "9afd021b-b99a-44bf-8913-01ae2a619a22", - "name": "Payments - Create[Verify Succeeded state]", - "request": { - "name": "Payments - Create[Verify Succeeded state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "735c6e14-3674-4bca-bf5f-aea3602f27bb", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'Succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"Succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "025759d4-0d71-4301-8d8a-08600cc14aea", - "name": "Payments - Retrieve[Verify succeeded state]", - "request": { - "name": "Payments - Retrieve[Verify succeeded state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "4b4c22bf-f8e6-4de2-8afd-5b3af4e98ff7", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'Succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"Succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "743ba4a9-e316-450e-b07f-ca9a67ff88d1", - "name": "Refunds - Create[Refund excess amount]", - "request": { - "name": "Refunds - Create[Refund excess amount]", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"{{payment_id}}\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\",\n \"amount\": \"70000\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "29a0cf76-9293-4540-9f84-681ff301557b", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/refunds - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/refunds - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/refunds - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Refund amount exceeds the payment amount\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'message' matches 'Refund amount exceeds the payment amount'\", function() {\n pm.expect(_resMessage).to.eql(\"Refund amount exceeds the payment amount\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "91176b0c-f62f-4e4f-b2ee-b318ff52bd9d", - "name": "Refunds - Create[Refund partial amount]", - "request": { - "name": "Refunds - Create[Refund partial amount]", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"{{payment_id}}\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\",\n \"amount\": \"500\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "bb9cc6bf-0354-426b-9868-5b9b00f5c084", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/refunds - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/refunds - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/refunds - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/refunds - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/refunds - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n", - "// Set property value as variable\nconst _resReason = jsonData?.reason;\n", - "// Response body should have \"reason\"\npm.test(\"[POST]::/refunds - Content check if 'reason' exists\", function() {\n pm.expect(_resReason !== undefined).to.be.true;\n});\n", - "// Response body should have value \"null\" for \"reason\"\nif (_resReason !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'reason' matches 'null'\", function() {\n pm.expect(_resReason).to.eql(\"null\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "6f7e7dcc-4c2e-4033-9be6-830a09213566", - "name": "Refunds - Create[Refund full amount]", - "request": { - "name": "Refunds - Create[Refund full amount]", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"{{payment_id}}\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "5bf96902-5e6c-46cb-9e6f-e4e452c4128a", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/refunds - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/refunds - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/refunds - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/refunds - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/refunds - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n", - "// Set property value as variable\nconst _resReason = jsonData?.reason;\n", - "// Response body should have \"reason\"\npm.test(\"[POST]::/refunds - Content check if 'reason' exists\", function() {\n pm.expect(_resReason !== undefined).to.be.true;\n});\n", - "// Response body should have value \"null\" for \"reason\"\nif (_resReason !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'reason' matches 'null'\", function() {\n pm.expect(_resReason).to.eql(\"null\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "f03dba36-c695-4368-a704-c64bb270cd2a", - "name": "Payments - Create[Verify RequireConfirmation state]", - "request": { - "name": "Payments - Create[Verify RequireConfirmation state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": false,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "be9f57a6-0c46-46cd-aa2e-721032517312", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_confirmation\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_confirmation\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "5ba7edc9-ada4-4647-83cc-5f1964e3e86b", - "name": "Payments - Retrieve[Verify RequireConfirmation state]", - "request": { - "name": "Payments - Retrieve[Verify RequireConfirmation state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "270f2841-b876-49b8-b4bf-cf1b9cdfab85", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_confirmation\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_confirmation\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "ddf25ac2-9fb3-4221-ad9f-c97e0f5b1b5b", - "name": "Refunds - Create[Refund pending payment]", - "request": { - "name": "Refunds - Create[Refund pending payment]", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"{{payment_id}}\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "3ffc0a87-ac74-4898-aeff-e2c03c4730c8", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/refunds - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/refunds - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/refunds - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Refund is not allowed for unsuccessful payment\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'message' matches 'Refund is not allowed for unsuccessful payment'\", function() {\n pm.expect(_resMessage).to.eql(\"Refund is not allowed for unsuccessful payment\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "57c03537-2bd6-4cf3-9507-00072e47a2a4", - "name": "Payments - Retrieve[Verify Succeeded after confirm]", - "request": { - "name": "Payments - Retrieve[Verify Succeeded after confirm]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "4c275998-bf68-417d-a3d4-397e2a791d29", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "df538a1a-5494-4f19-9e15-24e7c26c88a5", - "name": "Payments - Create[Verify RequiresPaymentMethod state]", - "request": { - "name": "Payments - Create[Verify RequiresPaymentMethod state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "a6bc3579-f8d7-4041-b915-1499b3b3d67d", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "a88a1b36-f2b9-4bea-8657-dddb962c4b02", - "name": "Payments - Retrieve[Verify RequiresPaymentMethod state]", - "request": { - "name": "Payments - Retrieve[Verify RequiresPaymentMethod state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "efcf9a7f-4284-4d37-bf37-87d7975784fd", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "192fc19b-51cf-40a5-91c1-4eb481f60f8a", - "name": "Payments - Create[Verify RequiresCapture state]", - "request": { - "name": "Payments - Create[Verify RequiresCapture state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": \"100\",\n \"currency\": \"INR\",\n \"confirm\": true,\n \"capture_method\": \"manual\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "47b4ee0e-08cb-40a0-b0cd-e9d27d649ca0", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_capture\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_capture\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"100\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '100'\", function() {\n pm.expect(_resAmount).to.eql(\"100\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"INR\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'INR'\", function() {\n pm.expect(_resCurrency).to.eql(\"INR\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "17835897-d8a9-49fb-b78a-55a190b21a26", - "name": "Payments - Retrieve[Verify RequiresCapture state]", - "request": { - "name": "Payments - Retrieve[Verify RequiresCapture state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "a9bc766a-9c37-4845-90d4-fc79ce71b1d3", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_capture\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'requires_capture'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_capture\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "02f9caf0-2f52-4456-9c5c-8b1e00f4c361", - "name": "Payments - Create[Pass Required Param]", - "request": { - "name": "Payments - Create[Pass Required Param]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "0ce854be-3a3d-4d28-937e-23c9bf2ea751", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "5c6011e9-d0b2-4be9-8526-30e4e13b71f6", - "name": "Payments - Retrieve[Verify RequiresPaymentMethod state]", - "request": { - "name": "Payments - Retrieve[Verify RequiresPaymentMethod state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "5464423f-fe4c-4c9f-aae8-fd8db9b4d7dd", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "3380c080-7211-4ecb-b2ac-71c66857b073", - "name": "Payments - Create[Verify RequiresCapture state]", - "request": { - "name": "Payments - Create[Verify RequiresCapture state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "4acfd38a-4505-4f31-bbe4-8f4c587dcdb1", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_capture\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_capture\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "ed78e9c8-c43c-4909-a7d5-7863ce8f9f10", - "name": "Payments - Create[Pass Invalid MerchantId]", - "request": { - "name": "Payments - Create[Pass Invalid MerchantId]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n },\n \"merchant_id\": \"123\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "4ec1fa3a-bcbc-4a91-b05b-ad05f79ec493", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid merchant id : 123\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid merchant id : 123'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid merchant id : 123\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "fb002d62-d1a5-419e-9724-22362e294a12", - "name": "Payments - Create[Pass Invalid Currency]", - "request": { - "name": "Payments - Create[Pass Invalid Currency]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"United\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "1a5db495-718a-46ce-a3da-37eb00fba0c1", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid currency : united\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid currency : united'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid currency : united\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "01266ac6-5cb2-4b3b-a767-8ce6a1e51c4e", - "name": "Payments - Create[Remove card number]", - "request": { - "name": "Payments - Create[Remove card number]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "f3ea360a-c0fb-4423-8f93-dda83d1e67c4", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Missing required param: payment_method_data[card_number].\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Missing required param: payment_method_data[card_number].'\", function() {\n pm.expect(_resMessage).to.eql(\"Missing required param: payment_method_data[card_number].\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "fbfce1ff-c0e3-402a-b0c4-3b76c554cced", - "name": "Payments - Create[Pass Invalid CaptureMethod]", - "request": { - "name": "Payments - Create[Pass Invalid CaptureMethod]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"Man\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "f80d5e66-1735-4fbb-8471-ecc780e9a4ed", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid capture_method: must be one of automatic or manual or scheduled\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid capture_method: must be one of automatic or manual or scheduled'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid capture_method: must be one of automatic or manual or scheduled\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "21a133bc-4d58-40ad-887e-10d6517b8437", - "name": "Payments - Create[Pass Invalid integer for amount]", - "request": { - "name": "Payments - Create[Pass Invalid integer for amount]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": \"abc\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "ce79c81d-3ff6-4455-a566-b65111ddf118", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid integer: abc\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid integer: abc'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid integer: abc\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "1591def1-ae4c-454f-a7bd-098fc70cc2e8", - "name": "Payments - Create[Pass negative integer for amount]", - "request": { - "name": "Payments - Create[Pass negative integer for amount]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": \"-20\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "923b37d4-f38d-4ea5-bbde-bcece9937775", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"This value must be greater than or equal to 1.\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'This value must be greater than or equal to 1.'\", function() {\n pm.expect(_resMessage).to.eql(\"This value must be greater than or equal to 1.\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "94ccc304-ec8f-4257-a2a3-aa7d863fd4c1", - "name": "Payments - Create[Pass Invalid PaymentMethod]", - "request": { - "name": "Payments - Create[Pass Invalid PaymentMethod]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card123\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "d07dfbb1-ce6b-46fb-bde3-e5ee31253ea3", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid capture_method: must be one of `card`, `banktransfer`, `bankdebit`, `netbanking`, `consumer_finance`, `wallet`, `upi`\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid capture_method: must be one of `card`, `banktransfer`, `bankdebit`, `netbanking`, `consumer_finance`, `wallet`, `upi`'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid capture_method: must be one of `card`, `banktransfer`, `bankdebit`, `netbanking`, `consumer_finance`, `wallet`, `upi`\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "db61b09e-2e8a-42b5-bd5f-79c2a9a089c3", - "name": "Payments - Create[CaptureAmount greater than orderAmount]", - "request": { - "name": "Payments - Create[CaptureAmount greater than orderAmount]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": \"6550\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "3bbb01c2-2a91-4748-a191-e0d0b9011e10", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Validation error : amount_to_capture is greater than amount\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Validation error : amount_to_capture is greater than amount'\", function() {\n pm.expect(_resMessage).to.eql(\"Validation error : amount_to_capture is greater than amount\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "3955c945-3be6-4948-9876-598b5c8200af", - "name": "Payments - Create[Not passing required params]", - "request": { - "name": "Payments - Create[Not passing required params]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "86913094-628f-45ff-95cd-3e33eb95cb14", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Missing required param: amount.\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Missing required param: amount.'\", function() {\n pm.expect(_resMessage).to.eql(\"Missing required param: amount.\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "663e89eb-f2a6-4ad5-ad5d-2d48ac980501", - "name": "Payments - Create[createPayment to update]", - "request": { - "name": "Payments - Create[createPayment to update]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "f74b8603-b530-4df4-99de-d54fd936e6a1", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "5bec4293-a2b6-4239-bb60-181b8fc7c2f9", - "name": "Payments - Create[Create SucceededPayment to update]", - "request": { - "name": "Payments - Create[Create SucceededPayment to update]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "edbdf17e-e98f-487a-b9b2-edbaa68f8112", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'Succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"Succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "d8e21433-403a-4357-b15a-e87bf999eeff", - "name": "Payments - Create[Create a mandates with on session]", - "request": { - "name": "Payments - Create[Create a mandates with on session]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OnsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"on_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "9b42f353-9be8-4fda-a0fd-602d6870559d", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", - "// Response body should have \"mandate_id\"\npm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"0\" for \"mandate_id\"\nif (_resMandateId !== undefined) {\npm.test(\"[POST]::/payments - Content check if value of 'mandate_id' has a minimum length of '0'\", function() {\n pm.expect(jsonData.mandate_id.length).is.at.least(0);\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "269d447f-ddd6-4295-94e7-fc06e7f30ad1", - "name": "Payments - Create[Create a mandates with off session]", - "request": { - "name": "Payments - Create[Create a mandates with off session]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OffsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "f22a0944-ea28-4fc5-8691-b20b4c0ee670", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", - "// Response body should have \"mandate_id\"\npm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"1\" for \"mandate_id\"\nif (_resMandateId !== undefined) {\npm.test(\"[POST]::/payments - Content check if value of 'mandate_id' has a minimum length of '1'\", function() {\n pm.expect(jsonData.mandate_id.length).is.at.least(1);\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "b68e988b-6f86-4404-9d18-2474cdf10a92", - "name": "Payments - Create[Create a mandates without customer id]", - "request": { - "name": "Payments - Create[Create a mandates without customer id]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "79c10e65-c791-4919-908e-0550321db3b2", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resErrorMessage = jsonData?.Error_message;\n", - "// Response body should have \"Error_message\"\npm.test(\"[POST]::/payments - Content check if 'Error_message' exists\", function() {\n pm.expect(_resErrorMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Customer Id is mandatory to create a mandates\" for \"Error_message\"\nif (_resErrorMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'Error_message' matches 'Customer Id is mandatory to create a mandates'\", function() {\n pm.expect(_resErrorMessage).to.eql(\"Customer Id is mandatory to create a mandates\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "f879062e-17de-42c8-80b0-7e3289c3531e", - "name": "Payments - Create[Create a mandates without customer id]", - "request": { - "name": "Payments - Create[Create a mandates without customer id]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "bb7d04cb-b4e8-4bde-bde5-0c97384a7757", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resErrorMessage = jsonData?.Error_message;\n", - "// Response body should have \"Error_message\"\npm.test(\"[POST]::/payments - Content check if 'Error_message' exists\", function() {\n pm.expect(_resErrorMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Customer Id is mandatory to create a mandates\" for \"Error_message\"\nif (_resErrorMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'Error_message' matches 'Customer Id is mandatory to create a mandates'\", function() {\n pm.expect(_resErrorMessage).to.eql(\"Customer Id is mandatory to create a mandates\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "7feae0f7-87fa-4002-b78b-5b99f0c525f2", - "name": "Payments - Create[Create a mandates without setupfutureusage]", - "request": { - "name": "Payments - Create[Create a mandates without setupfutureusage]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "0bcfb8c0-fe11-4a45-bc4a-fef7b41d059a", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resErrorMessage = jsonData?.Error_message;\n", - "// Response body should have \"Error_message\"\npm.test(\"[POST]::/payments - Content check if 'Error_message' exists\", function() {\n pm.expect(_resErrorMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Pass setupfuture usage to create a mandates\" for \"Error_message\"\nif (_resErrorMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'Error_message' matches 'Pass setupfuture usage to create a mandates'\", function() {\n pm.expect(_resErrorMessage).to.eql(\"Pass setupfuture usage to create a mandates\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "8fa13938-833a-4f24-88c7-580771cb82e3", - "name": "Payments - Create[Create a mandates without confirm as true]", - "request": { - "name": "Payments - Create[Create a mandates without confirm as true]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "42b46e44-ab0e-4b2c-a201-56b338751fa1", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resErrorMessage = jsonData?.Error_message;\n", - "// Response body should have \"Error_message\"\npm.test(\"[POST]::/payments - Content check if 'Error_message' exists\", function() {\n pm.expect(_resErrorMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Cant create a mandates when the confirm is true\" for \"Error_message\"\nif (_resErrorMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'Error_message' matches 'Cant create a mandates when the confirm is true'\", function() {\n pm.expect(_resErrorMessage).to.eql(\"Cant create a mandates when the confirm is true\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - } - ], - "event": [] - }, - { - "id": "34487d96-9635-4db3-8d36-88bb23929fc1", - "name": "Payments Variations", - "item": [ - { - "id": "36f784b0-6357-4e0e-965a-362b9a99dcf5", - "name": "Payments - Create[Verify Succeeded state]", - "request": { - "name": "Payments - Create[Verify Succeeded state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "802453ab-5016-4d13-b48a-4f5278a8f1dd", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'Succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"Succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "414c9904-0bc9-4be7-b2d5-8601ece0001c", - "name": "Payments - Retrieve[Verify succeeded state]", - "request": { - "name": "Payments - Retrieve[Verify succeeded state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "009ab409-01b5-4dec-96b9-f48b43b4a913", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'Succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"Succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "7085761b-068d-475a-82d6-d3b4df8e957c", - "name": "Payments - Confirm[confirm payment for succeeded state]", - "request": { - "name": "Payments - Confirm[confirm payment for succeeded state]", - "description": { - "content": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id", - "confirm" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "1522af75-a185-4412-82c5-9e5960446f6a", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments/:id/confirm - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"You cannot confirm this PaymentIntent because it has already succeeded after being previously confirmed.\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'message' matches 'You cannot confirm this PaymentIntent because it has already succeeded after being previously confirmed.'\", function() {\n pm.expect(_resMessage).to.eql(\"You cannot confirm this PaymentIntent because it has already succeeded after being previously confirmed.\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "84147458-d5a0-4aef-852b-069580694aba", - "name": "Payments - Create[Verify RequireConfirmation state]", - "request": { - "name": "Payments - Create[Verify RequireConfirmation state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": false,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "85a4af0e-ea35-49b4-8382-1244c940b943", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_confirmation\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_confirmation\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "9a99407c-7d0e-48ba-9287-b05826bcba44", - "name": "Payments - Retrieve[Verify RequireConfirmation state]", - "request": { - "name": "Payments - Retrieve[Verify RequireConfirmation state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "3fa72403-e124-40b1-8168-4b76084be572", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_confirmation\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_confirmation\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "5f2f78d0-0260-48f8-9cc6-8b3855fe3b5a", - "name": "Payments - Confirm[confirm the payment]", - "request": { - "name": "Payments - Confirm[confirm the payment]", - "description": { - "content": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id", - "confirm" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "9a84e0b6-f766-4f91-844f-803c4ece67a2", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments/:id/confirm - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "5615fa26-0f7b-4345-9c3e-70d84f2e6a3c", - "name": "Payments - Retrieve[Verify Succeeded after confirm]", - "request": { - "name": "Payments - Retrieve[Verify Succeeded after confirm]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "a8bb3128-8763-43b3-bb00-3749bfa54059", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "3658d4ed-0b0a-4afd-b1db-6faa88f00fd4", - "name": "Payments - Create[Verify RequiresPaymentMethod state]", - "request": { - "name": "Payments - Create[Verify RequiresPaymentMethod state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "01cf3dd8-047d-4f65-be2e-c20e2be9da50", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "c83c5acf-f7a2-474b-92ab-d33f77c687e3", - "name": "Payments - Retrieve[Verify RequiresPaymentMethod state]", - "request": { - "name": "Payments - Retrieve[Verify RequiresPaymentMethod state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "313a1b09-6a73-4d3d-b666-0d7c6c969af6", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "0bab42a3-34ff-4a3f-aa8d-a1d90edf02fa", - "name": "Payments - Confirm[confirm the payment which in requires_payment_method]", - "request": { - "name": "Payments - Confirm[confirm the payment which in requires_payment_method]", - "description": { - "content": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id", - "confirm" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"return_url\": \"http://example.com/payments\",\n \"payment_method\": \"card\",\n \"save_payment_method\": true,\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"35\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\"\n }\n },\n \"shipping\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"billing\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "0459b90d-0d6f-4879-ad59-f66b884a2a01", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments/:id/confirm - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "2f9eff48-36cb-476e-80d8-7288aef3633a", - "name": "Payments - Create[Verify RequiresCapture state]", - "request": { - "name": "Payments - Create[Verify RequiresCapture state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": \"100\",\n \"currency\": \"INR\",\n \"confirm\": true,\n \"capture_method\": \"manual\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "65cf8eeb-9fcb-425f-b949-39f617487a7a", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_capture\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_capture\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"100\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '100'\", function() {\n pm.expect(_resAmount).to.eql(\"100\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"INR\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'INR'\", function() {\n pm.expect(_resCurrency).to.eql(\"INR\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "9e4a41f8-931f-453e-9df7-e11aa801d751", - "name": "Payments - Retrieve[Verify RequiresCapture state]", - "request": { - "name": "Payments - Retrieve[Verify RequiresCapture state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "388608ca-eb38-4ef4-a5b1-69a7d3d6aa3c", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_capture\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'requires_capture'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_capture\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "8761e2a6-6ff1-4d9e-af9b-550a04b2e716", - "name": "Payments - Create[Pass Required Param]", - "request": { - "name": "Payments - Create[Pass Required Param]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "92d297c2-6838-49f1-94d5-477d012ceb1d", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "ce82f492-5dc2-43cc-a6d1-9c2f1d5e4da4", - "name": "Payments - Retrieve[Verify RequiresPaymentMethod state]", - "request": { - "name": "Payments - Retrieve[Verify RequiresPaymentMethod state]", - "description": { - "content": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "861b4a5b-28dc-4af7-9aeb-37f9d6fcc62a", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[GET]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[GET]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[GET]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ] - }, - { - "id": "92766fd1-1038-4517-9769-2a925141365c", - "name": "Payments - Create[Verify RequiresCapture state]", - "request": { - "name": "Payments - Create[Verify RequiresCapture state]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "1980b0ea-ec03-4f6c-aea2-f917096c5fc9", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_capture\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_capture\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "e43646a0-694c-4c6a-9ff7-d0b8b5b1d3c0", - "name": "Payments - Create[Pass Invalid MerchantId]", - "request": { - "name": "Payments - Create[Pass Invalid MerchantId]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n },\n \"merchant_id\": \"123\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "6b8230c1-4299-40f3-b619-70d5e2593a20", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid merchant id : 123\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid merchant id : 123'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid merchant id : 123\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "0b02095e-d3dd-4c2b-875c-e1f1792af598", - "name": "Payments - Create[Pass Invalid Currency]", - "request": { - "name": "Payments - Create[Pass Invalid Currency]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"United\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "84e705f2-02e7-4b83-b9b4-3abffd6a428f", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid currency : united\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid currency : united'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid currency : united\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "ad6b56c7-0ed9-4afd-96b7-0c3139073698", - "name": "Payments - Create[Remove card number]", - "request": { - "name": "Payments - Create[Remove card number]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "5151405e-e5fb-4eff-8b2e-9adfa7537dc3", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Missing required param: payment_method_data[card_number].\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Missing required param: payment_method_data[card_number].'\", function() {\n pm.expect(_resMessage).to.eql(\"Missing required param: payment_method_data[card_number].\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "2ea72539-c493-4d38-9919-73e37bdf0d6b", - "name": "Payments - Create[Pass Invalid CaptureMethod]", - "request": { - "name": "Payments - Create[Pass Invalid CaptureMethod]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"Man\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "08ce1b6f-99d1-4a4e-9e8c-4460e86ca40e", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid capture_method: must be one of automatic or manual or scheduled\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid capture_method: must be one of automatic or manual or scheduled'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid capture_method: must be one of automatic or manual or scheduled\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "005e26b3-c8e0-4d33-b7e2-d398e256e0dd", - "name": "Payments - Create[Pass Invalid integer for amount]", - "request": { - "name": "Payments - Create[Pass Invalid integer for amount]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": \"abc\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "0046b117-5181-442b-bb9d-2a655cc09585", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid integer: abc\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid integer: abc'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid integer: abc\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "76e2273c-5593-493d-add3-70a58cb4cc05", - "name": "Payments - Create[Pass negative integer for amount]", - "request": { - "name": "Payments - Create[Pass negative integer for amount]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": \"-20\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "e68ec54a-818b-4d30-b387-ac96424bf9f2", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"This value must be greater than or equal to 1.\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'This value must be greater than or equal to 1.'\", function() {\n pm.expect(_resMessage).to.eql(\"This value must be greater than or equal to 1.\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "573dd174-d3b8-44a0-b289-47f437e19c9a", - "name": "Payments - Create[Pass Invalid PaymentMethod]", - "request": { - "name": "Payments - Create[Pass Invalid PaymentMethod]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card123\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "8cbdd97d-85c4-4011-855b-7dac7ab71a03", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Invalid capture_method: must be one of `card`, `banktransfer`, `bankdebit`, `netbanking`, `consumer_finance`, `wallet`, `upi`\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Invalid capture_method: must be one of `card`, `banktransfer`, `bankdebit`, `netbanking`, `consumer_finance`, `wallet`, `upi`'\", function() {\n pm.expect(_resMessage).to.eql(\"Invalid capture_method: must be one of `card`, `banktransfer`, `bankdebit`, `netbanking`, `consumer_finance`, `wallet`, `upi`\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "e931089e-784d-4360-ab89-499769898595", - "name": "Payments - Create[CaptureAmount greater than orderAmount]", - "request": { - "name": "Payments - Create[CaptureAmount greater than orderAmount]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": \"6550\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "209cf381-a351-4766-b2d0-53a81d079c6b", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Validation error : amount_to_capture is greater than amount\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Validation error : amount_to_capture is greater than amount'\", function() {\n pm.expect(_resMessage).to.eql(\"Validation error : amount_to_capture is greater than amount\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "a6ce8adf-b74f-409d-86ba-0a555ae4fa2b", - "name": "Payments - Create[Not passing required params]", - "request": { - "name": "Payments - Create[Not passing required params]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "7d8be826-e1cb-4834-a4e7-dc97541c6ada", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Missing required param: amount.\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'message' matches 'Missing required param: amount.'\", function() {\n pm.expect(_resMessage).to.eql(\"Missing required param: amount.\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "c35092bb-9e16-4cc7-9588-851ded991344", - "name": "Payments - Create[createPayment to update]", - "request": { - "name": "Payments - Create[createPayment to update]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "a9aa336c-0049-47eb-b06f-e19794f09c33", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_payment_method\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_payment_method\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "5a9c8041-9c4d-4413-b373-34ce251e3276", - "name": "Payments - Update[Update the amount]", - "request": { - "name": "Payments - Update[Update the amount]", - "description": { - "content": "To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created ", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": \"200\",\n \"currency\": \"USD\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2022-09-10T10:11:12Z\",\n \"amount_to_capture\": 6540,\n \"amount_capturable\": 6540,\n \"customer_id\": \"cus_udst2tfldj6upmye2reztkmm4i\",\n \"email\": \"guest@example.com\",\n \"name\": \"John Doe\",\n \"phone\": \"999999999\",\n \"phone_country_code\": \"+65\",\n \"description\": \"Its my first payment request\",\n \"setup_future_usage\": \"optional\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"save_payment_method\": true,\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"35\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\"\n }\n },\n \"statement_descriptor_name\": \"Juspay\",\n \"statement_descriptor_suffix\": \"Router\",\n \"shipping\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"billing\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "39dfd93e-712e-4cb3-acf4-9029254b78fb", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_confirmation\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_confirmation\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"200\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments/:id - Content check if value for 'amount' matches '200'\", function() {\n pm.expect(_resAmount).to.eql(\"200\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments/:id - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "9970aea3-31e4-42cc-b496-550ba908709e", - "name": "Payments - Update[Update the currency]", - "request": { - "name": "Payments - Update[Update the currency]", - "description": { - "content": "To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created ", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"SGD\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2022-09-10T10:11:12Z\",\n \"amount_to_capture\": 6540,\n \"amount_capturable\": 6540,\n \"customer_id\": \"cus_udst2tfldj6upmye2reztkmm4i\",\n \"email\": \"guest@example.com\",\n \"name\": \"John Doe\",\n \"phone\": \"999999999\",\n \"phone_country_code\": \"+65\",\n \"description\": \"Its my first payment request\",\n \"setup_future_usage\": \"optional\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"save_payment_method\": true,\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"35\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\"\n }\n },\n \"statement_descriptor_name\": \"Juspay\",\n \"statement_descriptor_suffix\": \"Router\",\n \"shipping\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"billing\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "d5f15e1a-659b-4ad9-a91b-e21f15a30193", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"requires_confirmation\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\", function() {\n pm.expect(_resStatus).to.eql(\"requires_confirmation\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments/:id - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"200\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments/:id - Content check if value for 'amount' matches '200'\", function() {\n pm.expect(_resAmount).to.eql(\"200\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments/:id - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"SGD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments/:id - Content check if value for 'currency' matches 'SGD'\", function() {\n pm.expect(_resCurrency).to.eql(\"SGD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "e07879ee-5b66-4a82-9148-0691e61efca6", - "name": "Payments - Create[Create SucceededPayment to update]", - "request": { - "name": "Payments - Create[Create SucceededPayment to update]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "be227f3e-9055-4886-a0bc-faa945c84ef0", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'status' matches 'Succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"Succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/payments - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/payments - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "535b66dc-ce0a-452a-a3b0-187fa82fa6fb", - "name": "Payments - Update[Update Succeeded payment]", - "request": { - "name": "Payments - Update[Update Succeeded payment]", - "description": { - "content": "To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created ", - "type": "text/plain" - }, - "url": { - "path": [ - "payments", - ":id", - ":amount" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) unique payment id", - "type": "text/plain" - }, - "type": "string", - "value": "{{payment_id}}", - "key": "id" - }, - { - "disabled": false, - "type": "any", - "value": "1000", - "key": "amount" - } - ] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2022-09-10T10:11:12Z\",\n \"amount_to_capture\": 6540,\n \"amount_capturable\": 6540,\n \"customer_id\": \"cus_udst2tfldj6upmye2reztkmm4i\",\n \"email\": \"guest@example.com\",\n \"name\": \"John Doe\",\n \"phone\": \"999999999\",\n \"phone_country_code\": \"+65\",\n \"description\": \"Its my first payment request\",\n \"setup_future_usage\": \"optional\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"save_payment_method\": true,\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"35\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\"\n }\n },\n \"statement_descriptor_name\": \"Juspay\",\n \"statement_descriptor_suffix\": \"Router\",\n \"shipping\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"billing\": {\n \"city\": \"Bangalore\",\n \"country\": \"IN\",\n \"line1\": \"Juspay router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "af33e6c9-961b-4159-82be-87c18dbb8c5b", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments/:id - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/payments/:id - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"This Payment's amount could not be updated because it has a status of succeeded.\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/payments/:id - Content check if value for 'message' matches 'This Payment's amount could not be updated because it has a status of succeeded.'\", function() {\n pm.expect(_resMessage).to.eql(\"This Payment's amount could not be updated because it has a status of succeeded.\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "2d8e9106-180b-4336-8d6b-b169e37de587", - "name": "Payments - Create[Create a mandates with on session]", - "request": { - "name": "Payments - Create[Create a mandates with on session]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OnsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"on_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "3bf4b6ed-b1e5-41b5-8403-71e271de21ba", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", - "// Response body should have \"mandate_id\"\npm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"0\" for \"mandate_id\"\nif (_resMandateId !== undefined) {\npm.test(\"[POST]::/payments - Content check if value of 'mandate_id' has a minimum length of '0'\", function() {\n pm.expect(jsonData.mandate_id.length).is.at.least(0);\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "1fbbcfe1-a6ae-427e-a163-81dad4eb7486", - "name": "Payments - Create[Create a mandates with off session]", - "request": { - "name": "Payments - Create[Create a mandates with off session]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OffsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "4cbda17d-33c9-4452-ae25-70ea05d49140", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"JohnTest@test.com\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", - "// Response body should have \"mandate_id\"\npm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"1\" for \"mandate_id\"\nif (_resMandateId !== undefined) {\npm.test(\"[POST]::/payments - Content check if value of 'mandate_id' has a minimum length of '1'\", function() {\n pm.expect(jsonData.mandate_id.length).is.at.least(1);\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "95009e69-8b1d-4fe0-bd6f-ad9dfbcb6535", - "name": "Payments - Create[Create a mandates without customer id]", - "request": { - "name": "Payments - Create[Create a mandates without customer id]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "f9d10652-af45-4cc6-958e-52956f0864a2", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resErrorMessage = jsonData?.Error_message;\n", - "// Response body should have \"Error_message\"\npm.test(\"[POST]::/payments - Content check if 'Error_message' exists\", function() {\n pm.expect(_resErrorMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Customer Id is mandatory to create a mandates\" for \"Error_message\"\nif (_resErrorMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'Error_message' matches 'Customer Id is mandatory to create a mandates'\", function() {\n pm.expect(_resErrorMessage).to.eql(\"Customer Id is mandatory to create a mandates\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "fdae6ded-815c-4f33-b999-9c6b269fee41", - "name": "Payments - Create[Create a mandates without customer id]", - "request": { - "name": "Payments - Create[Create a mandates without customer id]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "00055ee5-f7e0-44e9-8800-a8ed6d06916e", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resErrorMessage = jsonData?.Error_message;\n", - "// Response body should have \"Error_message\"\npm.test(\"[POST]::/payments - Content check if 'Error_message' exists\", function() {\n pm.expect(_resErrorMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Customer Id is mandatory to create a mandates\" for \"Error_message\"\nif (_resErrorMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'Error_message' matches 'Customer Id is mandatory to create a mandates'\", function() {\n pm.expect(_resErrorMessage).to.eql(\"Customer Id is mandatory to create a mandates\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "597edbe1-c123-4d1d-898f-f7e6d7bf0591", - "name": "Payments - Create[Create a mandates without setupfutureusage]", - "request": { - "name": "Payments - Create[Create a mandates without setupfutureusage]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "118ca68a-44e8-4fbc-a2a6-67d156f93b09", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resErrorMessage = jsonData?.Error_message;\n", - "// Response body should have \"Error_message\"\npm.test(\"[POST]::/payments - Content check if 'Error_message' exists\", function() {\n pm.expect(_resErrorMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Pass setupfuture usage to create a mandates\" for \"Error_message\"\nif (_resErrorMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'Error_message' matches 'Pass setupfuture usage to create a mandates'\", function() {\n pm.expect(_resErrorMessage).to.eql(\"Pass setupfuture usage to create a mandates\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "8caf03a7-5218-4c5d-b3ac-7b84eedf2749", - "name": "Payments - Create[Create a mandates without confirm as true]", - "request": { - "name": "Payments - Create[Create a mandates without confirm as true]", - "description": { - "content": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", - "type": "text/plain" - }, - "url": { - "path": [ - "payments" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"JohnTest@test.com\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "6fc9ae6e-3e44-47c7-b452-922f0ffa1708", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 400\", function () {\n pm.expect(pm.response.code).to.equal(400);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"The error code\",\"maxLength\":255,\"example\":\"parameter_missing\"},\"message\":{\"type\":\"string\",\"description\":\"Missing required param: \",\"maxLength\":255,\"example\":\"Missing required param: amount\"},\"type\":{\"type\":\"string\",\"description\":\"The category to which the error belongs\",\"maxLength\":255,\"example\":\"invalid_request_error\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resErrorMessage = jsonData?.Error_message;\n", - "// Response body should have \"Error_message\"\npm.test(\"[POST]::/payments - Content check if 'Error_message' exists\", function() {\n pm.expect(_resErrorMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Cant create a mandates when the confirm is true\" for \"Error_message\"\nif (_resErrorMessage !== undefined) {\npm.test(\"[POST]::/payments - Content check if value for 'Error_message' matches 'Cant create a mandates when the confirm is true'\", function() {\n pm.expect(_resErrorMessage).to.eql(\"Cant create a mandates when the confirm is true\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - } - ], - "event": [] - }, - { - "id": "4452ff00-db7a-4ef0-939e-1649ad89fbc2", - "name": "Refunds Variations", - "item": [ - { - "id": "374ac387-0b62-41d0-8ae7-fb39cfc0b602", - "name": "Refunds - Create[Refund excess amount]", - "request": { - "name": "Refunds - Create[Refund excess amount]", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"{{payment_id}}\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\",\n \"amount\": \"70000\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "3dfdc8a6-5122-4445-ace8-21a82753a23b", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/refunds - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/refunds - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/refunds - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Refund amount exceeds the payment amount\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'message' matches 'Refund amount exceeds the payment amount'\", function() {\n pm.expect(_resMessage).to.eql(\"Refund amount exceeds the payment amount\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "6e939cd7-8e22-4d7a-b6e5-3bc7478c64f7", - "name": "Refunds - Create[Refund partial amount]", - "request": { - "name": "Refunds - Create[Refund partial amount]", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"{{payment_id}}\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\",\n \"amount\": \"500\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "bab6c9f8-080b-4bb1-9398-d994c882e917", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/refunds - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/refunds - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/refunds - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/refunds - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/refunds - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n", - "// Set property value as variable\nconst _resReason = jsonData?.reason;\n", - "// Response body should have \"reason\"\npm.test(\"[POST]::/refunds - Content check if 'reason' exists\", function() {\n pm.expect(_resReason !== undefined).to.be.true;\n});\n", - "// Response body should have value \"null\" for \"reason\"\nif (_resReason !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'reason' matches 'null'\", function() {\n pm.expect(_resReason).to.eql(\"null\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "e4a6902a-0165-4f53-9b35-84f4e3a25cbd", - "name": "Refunds - Create[Refund full amount]", - "request": { - "name": "Refunds - Create[Refund full amount]", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"{{payment_id}}\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "b9c4ebda-87b8-449c-96f7-c2b9a1a2bb8f", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/refunds - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/refunds - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[POST]::/refunds - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"succeeded\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", function() {\n pm.expect(_resStatus).to.eql(\"succeeded\");\n})};\n", - "// Set property value as variable\nconst _resAmount = jsonData?.amount;\n", - "// Response body should have \"amount\"\npm.test(\"[POST]::/refunds - Content check if 'amount' exists\", function() {\n pm.expect(_resAmount !== undefined).to.be.true;\n});\n", - "// Response body should have value \"6540\" for \"amount\"\nif (_resAmount !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '6540'\", function() {\n pm.expect(_resAmount).to.eql(\"6540\");\n})};\n", - "// Set property value as variable\nconst _resCurrency = jsonData?.currency;\n", - "// Response body should have \"currency\"\npm.test(\"[POST]::/refunds - Content check if 'currency' exists\", function() {\n pm.expect(_resCurrency !== undefined).to.be.true;\n});\n", - "// Response body should have value \"USD\" for \"currency\"\nif (_resCurrency !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'USD'\", function() {\n pm.expect(_resCurrency).to.eql(\"USD\");\n})};\n", - "// Set property value as variable\nconst _resReason = jsonData?.reason;\n", - "// Response body should have \"reason\"\npm.test(\"[POST]::/refunds - Content check if 'reason' exists\", function() {\n pm.expect(_resReason !== undefined).to.be.true;\n});\n", - "// Response body should have value \"null\" for \"reason\"\nif (_resReason !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'reason' matches 'null'\", function() {\n pm.expect(_resReason).to.eql(\"null\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - }, - { - "id": "1afdab4a-df00-4518-8e5e-05dd46fd8577", - "name": "Refunds - Create[Refund pending payment]", - "request": { - "name": "Refunds - Create[Refund pending payment]", - "description": { - "content": "To create a refund against an already processed payment", - "type": "text/plain" - }, - "url": { - "path": [ - "refunds" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "POST", - "body": { - "mode": "raw", - "raw": "{\n \"payment_id\": \"{{payment_id}}\",\n \"refund_id\": \"a8537066-2569-4ac4-a7d3-87453387b09b\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "633c10f3-d728-4155-a382-7f3668bd169d", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[POST]::/refunds - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[POST]::/refunds - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"amount\",\"refund_id\",\"payment_id\",\"currency\",\"status\"],\"properties\":{\"amount\":{\"type\":\"integer\",\"description\":\"The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":1,\"example\":6540},\"refund_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refund initiated against the same payment.\\nIf the identifiers is not defined by the merchant, this filed shall be auto generated and provide in the API response.\\nIt is recommended to generate uuid(v4) as the refund_id.\\n\",\"maxLength\":30,\"minLength\":30,\"example\":\"ref_mbabizu24mvu3mela5njyhpit4\"},\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"reason\":{\"type\":\"string\",\"description\":\"An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive\",\"maxLength\":255,\"example\":\"Customer returned the product\"},\"metadata\":{\"type\":\"object\",\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/refunds - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", - "// Response body should have \"message\"\npm.test(\"[POST]::/refunds - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Refund is not allowed for unsuccessful payment\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'message' matches 'Refund is not allowed for unsuccessful payment'\", function() {\n pm.expect(_resMessage).to.eql(\"Refund is not allowed for unsuccessful payment\");\n})};\n" - ] - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - } - } - ], - "event": [] - }, - { - "id": "1e5bae97-fb73-41ad-b082-90dec1d643d8", - "name": "Mandates Variations", - "item": [ - { - "id": "46e0c371-ad26-44e5-a944-9a2fd657d418", - "name": "Mandate - List all mandates against a customer id[Get mandates for Customer]", - "request": { - "name": "Mandate - List all mandates against a customer id[Get mandates for Customer]", - "description": { - "content": "To list the all the mandates for a customer", - "type": "text/plain" - }, - "url": { - "path": [ - "customers", - ":customer_id", - "mandates" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) Unique customer id for which the list of mandates to be retrieved.", - "type": "text/plain" - }, - "type": "string", - "value": "OffsessionCustomer", - "key": "customer_id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "5a54f274-d60e-4811-8d54-0a5d336e7281", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/customers/:customer_id/mandates - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/customers/:customer_id/mandates - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"array\",\"items\":{\"type\":\"object\",\"description\":\"Mandate Payment Create Response\",\"required\":[\"mandate_id\",\"status\",\"payment_method_id\"],\"properties\":{\"mandate_id\":{\"type\":\"string\",\"description\":\"The unique id corresponding to the mandate.\\n\",\"example\":\"mandate_end38934n12s923d0\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the mandate, which indicates whether it can be used to initiate a payment.\",\"enum\":[\"active\",\"inactive\",\"pending\",\"revoked\"],\"example\":\"active\"},\"type\":{\"type\":\"string\",\"description\":\"The type of the mandate. (i) single_use refers to one-time mandates and (ii) multi-user refers to multiple payments.\",\"enum\":[\"multi_use\",\"single_use\"],\"default\":\"multi_use\",\"example\":\"multi_use\"},\"payment_method_id\":{\"type\":\"string\",\"description\":\"The id corresponding to the payment method.\",\"example\":\"pm_end38934n12s923d0\"},\"payment_method\":{\"type\":\"string\",\"description\":\"The type of payment method use for the payment.\\n\",\"enum\":[\"card\",\"payment_container\",\"bank_transfer\",\"bank_debit\",\"pay_later\",\"upi\",\"netbanking\"],\"example\":\"card\"},\"card\":{\"description\":\"The card identifier information to be displayed on the user interface\",\"type\":\"object\",\"properties\":{\"last4_digits\":{\"type\":\"string\",\"description\":\"The last four digits of the case which could be displayed to the end user for identification.\",\"example\":\"xxxxxxxxxxxx4242\"},\"card_exp_month\":{\"type\":\"string\",\"description\":\"The expiry month for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"10\"},\"card_exp_year\":{\"type\":\"string\",\"description\":\"Expiry year for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"25\"},\"card_holder_name\":{\"type\":\"string\",\"description\":\"The name of card holder\",\"maxLength\":255,\"example\":\"John Doe\"},\"card_token\":{\"type\":\"string\",\"description\":\"The token provided against a user's saved card. The token would be valid for 15 minutes.\",\"minLength\":30,\"maxLength\":30,\"example\":\"tkn_78892490hfh3r834rd\"},\"scheme\":{\"type\":\"string\",\"description\":\"The card scheme network for the particular card\",\"example\":\"MASTER\"},\"issuer_country\":{\"type\":\"string\",\"description\":\"The country code in in which the card was issued\",\"minLength\":2,\"maxLength\":2,\"example\":\"US\"},\"card_fingerprint\":{\"type\":\"string\",\"description\":\"A unique identifier alias to identify a particular card.\",\"minLength\":30,\"maxLength\":30,\"example\":\"fpt_78892490hfh3r834rd\"}}},\"customer_acceptance\":{\"description\":\"The card identifier information to be displayed on the user interface\",\"type\":\"object\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/customers/:customer_id/mandates - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", - "// Response body should have \"mandate_id\"\npm.test(\"[GET]::/customers/:customer_id/mandates - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"1\" for \"mandate_id\"\nif (_resMandateId !== undefined) {\npm.test(\"[GET]::/customers/:customer_id/mandates - Content check if value of 'mandate_id' has a minimum length of '1'\", function() {\n pm.expect(jsonData.mandate_id.length).is.at.least(1);\n})};\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/customers/:customer_id/mandates - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"active\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/customers/:customer_id/mandates - Content check if value for 'status' matches 'active'\", function() {\n pm.expect(_resStatus).to.eql(\"active\");\n})};\n" - ] - } - } - ] - }, - { - "id": "2a0553d7-8477-48db-be19-8e16214645db", - "name": "Mandate - List details of a mandate[Get mandates for Customer]", - "request": { - "name": "Mandate - List details of a mandate[Get mandates for Customer]", - "description": { - "content": "To list the details of a mandate", - "type": "text/plain" - }, - "url": { - "path": [ - "mandates", - ":id", - ":customer_id" - ], - "host": [ - "{{baseUrl}}" - ], - "query": [], - "variable": [ - { - "disabled": false, - "description": { - "content": "(Required) Unique mandate id", - "type": "text/plain" - }, - "type": "any", - "value": "deserunt qui elit cupidatat", - "key": "id" - }, - { - "disabled": false, - "type": "any", - "value": "OffsessionCustomer", - "key": "customer_id" - } - ] - }, - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "method": "GET" - }, - "response": [], - "event": [ - { - "listen": "test", - "script": { - "id": "3fca3296-08f6-455e-8e0c-53a7b4fc8be1", - "type": "text/javascript", - "exec": [ - "// Validate response status code \npm.test(\"[GET]::/mandates/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", - "// Validate if response has JSON Body \npm.test(\"[GET]::/mandates/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"description\":\"Mandate Payment Create Response\",\"required\":[\"mandate_id\",\"status\",\"payment_method_id\"],\"properties\":{\"mandate_id\":{\"type\":\"string\",\"description\":\"The unique id corresponding to the mandate.\\n\",\"example\":\"mandate_end38934n12s923d0\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the mandate, which indicates whether it can be used to initiate a payment.\",\"enum\":[\"active\",\"inactive\",\"pending\",\"revoked\"],\"example\":\"active\"},\"type\":{\"type\":\"string\",\"description\":\"The type of the mandate. (i) single_use refers to one-time mandates and (ii) multi-user refers to multiple payments.\",\"enum\":[\"multi_use\",\"single_use\"],\"default\":\"multi_use\",\"example\":\"multi_use\"},\"payment_method_id\":{\"type\":\"string\",\"description\":\"The id corresponding to the payment method.\",\"example\":\"pm_end38934n12s923d0\"},\"payment_method\":{\"type\":\"string\",\"description\":\"The type of payment method use for the payment.\\n\",\"enum\":[\"card\",\"payment_container\",\"bank_transfer\",\"bank_debit\",\"pay_later\",\"upi\",\"netbanking\"],\"example\":\"card\"},\"card\":{\"description\":\"The card identifier information to be displayed on the user interface\",\"type\":\"object\",\"properties\":{\"last4_digits\":{\"type\":\"string\",\"description\":\"The last four digits of the case which could be displayed to the end user for identification.\",\"example\":\"xxxxxxxxxxxx4242\"},\"card_exp_month\":{\"type\":\"string\",\"description\":\"The expiry month for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"10\"},\"card_exp_year\":{\"type\":\"string\",\"description\":\"Expiry year for the card\",\"maxLength\":2,\"minLength\":2,\"example\":\"25\"},\"card_holder_name\":{\"type\":\"string\",\"description\":\"The name of card holder\",\"maxLength\":255,\"example\":\"John Doe\"},\"card_token\":{\"type\":\"string\",\"description\":\"The token provided against a user's saved card. The token would be valid for 15 minutes.\",\"minLength\":30,\"maxLength\":30,\"example\":\"tkn_78892490hfh3r834rd\"},\"scheme\":{\"type\":\"string\",\"description\":\"The card scheme network for the particular card\",\"example\":\"MASTER\"},\"issuer_country\":{\"type\":\"string\",\"description\":\"The country code in in which the card was issued\",\"minLength\":2,\"maxLength\":2,\"example\":\"US\"},\"card_fingerprint\":{\"type\":\"string\",\"description\":\"A unique identifier alias to identify a particular card.\",\"minLength\":30,\"maxLength\":30,\"example\":\"fpt_78892490hfh3r834rd\"}}},\"customer_acceptance\":{\"description\":\"The card identifier information to be displayed on the user interface\",\"type\":\"object\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/mandates/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", - "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", - "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", - "// Response body should have \"mandate_id\"\npm.test(\"[GET]::/mandates/:id - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", - "// Response body should have a minimum length of \"1\" for \"mandate_id\"\nif (_resMandateId !== undefined) {\npm.test(\"[GET]::/mandates/:id - Content check if value of 'mandate_id' has a minimum length of '1'\", function() {\n pm.expect(jsonData.mandate_id.length).is.at.least(1);\n})};\n", - "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", - "// Response body should have \"status\"\npm.test(\"[GET]::/mandates/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", - "// Response body should have value \"active\" for \"status\"\nif (_resStatus !== undefined) {\npm.test(\"[GET]::/mandates/:id - Content check if value for 'status' matches 'active'\", function() {\n pm.expect(_resStatus).to.eql(\"active\");\n})};\n" - ] - } - } - ] - } - ], - "event": [] - } - ], - "event": [] - } - ], - "auth": { - "type": "apikey", - "apikey": [ - { - "type": "any", - "value": "api-key", - "key": "key" - }, - { - "type": "any", - "value": "{{apiKey}}", - "key": "value" - }, - { - "type": "any", - "value": "header", - "key": "in" - } - ] - }, - "event": [], - "variable": [ - { - "type": "string", - "value": "https://sandbox.hyperswitch.io", - "key": "baseUrl" - } - ], - "info": { - "_postman_id": "3dc82900-7204-449f-84e4-166e61c8258c", - "name": "Juspay Router - API Documentation", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "description": { - "content": "## Get started\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes.\nYou can consume the APIs directly using your favorite HTTP/REST library.\nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n### Base URLs\nUse the following base URLs when making requests to the APIs:\n\n | Environment | Base URL |\n |---------------|------------------------------------------------------|\n | Sandbox | |\n | Production | |\n\n# Authentication\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header.\nNever share your secret api keys. Keep them guarded and secure.\n\n\nContact Support:\n Name: Juspay Support\n Email: support@juspay.in", - "type": "text/plain" - } - } -} \ No newline at end of file