{
  "info": {
    "name": "DzWallet Payment API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Test mode uses TEST keys and never contacts a real gateway. Never share the secret key."
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://dzwallet.app"
    },
    {
      "key": "test_public_key",
      "value": ""
    },
    {
      "key": "live_public_key",
      "value": ""
    },
    {
      "key": "live_secret_key",
      "value": ""
    },
    {
      "key": "identifier",
      "value": ""
    },
    {
      "key": "reference",
      "value": "ORD1042"
    }
  ],
  "item": [
    {
      "name": "Payments",
      "item": [
        {
          "name": "Initiate TEST payment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/test/payment/initiate",
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "public_key",
                  "value": "{{test_public_key}}",
                  "type": "text"
                },
                {
                  "key": "identifier",
                  "value": "ORD{{$timestamp}}",
                  "type": "text"
                },
                {
                  "key": "currency",
                  "value": "DZD",
                  "type": "text"
                },
                {
                  "key": "amount",
                  "value": "1000",
                  "type": "text"
                },
                {
                  "key": "details",
                  "value": "Order test",
                  "type": "text"
                },
                {
                  "key": "ipn_url",
                  "value": "https://yourshop.dz/ipn",
                  "type": "text"
                },
                {
                  "key": "success_url",
                  "value": "https://yourshop.dz/success",
                  "type": "text"
                },
                {
                  "key": "cancel_url",
                  "value": "https://yourshop.dz/cancel",
                  "type": "text"
                },
                {
                  "key": "site_name",
                  "value": "My shop",
                  "type": "text"
                },
                {
                  "key": "gateway_methods[]",
                  "value": "Satim",
                  "type": "text"
                },
                {
                  "key": "customer[first_name]",
                  "value": "Test",
                  "type": "text"
                },
                {
                  "key": "customer[last_name]",
                  "value": "User",
                  "type": "text"
                },
                {
                  "key": "customer[email]",
                  "value": "test@example.com",
                  "type": "text"
                },
                {
                  "key": "customer[mobile]",
                  "value": "0555000000",
                  "type": "text"
                }
              ]
            },
            "description": "Returns redirect_url. Domains of the three URLs must be registered in your merchant profile."
          }
        },
        {
          "name": "Initiate LIVE payment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/payment/initiate",
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "public_key",
                  "value": "{{live_public_key}}",
                  "type": "text"
                },
                {
                  "key": "identifier",
                  "value": "ORD{{$timestamp}}",
                  "type": "text"
                },
                {
                  "key": "currency",
                  "value": "DZD",
                  "type": "text"
                },
                {
                  "key": "amount",
                  "value": "1000",
                  "type": "text"
                },
                {
                  "key": "details",
                  "value": "Order test",
                  "type": "text"
                },
                {
                  "key": "ipn_url",
                  "value": "https://yourshop.dz/ipn",
                  "type": "text"
                },
                {
                  "key": "success_url",
                  "value": "https://yourshop.dz/success",
                  "type": "text"
                },
                {
                  "key": "cancel_url",
                  "value": "https://yourshop.dz/cancel",
                  "type": "text"
                },
                {
                  "key": "site_name",
                  "value": "My shop",
                  "type": "text"
                },
                {
                  "key": "gateway_methods[]",
                  "value": "Satim",
                  "type": "text"
                },
                {
                  "key": "customer[first_name]",
                  "value": "Test",
                  "type": "text"
                },
                {
                  "key": "customer[last_name]",
                  "value": "User",
                  "type": "text"
                },
                {
                  "key": "customer[email]",
                  "value": "test@example.com",
                  "type": "text"
                },
                {
                  "key": "customer[mobile]",
                  "value": "0555000000",
                  "type": "text"
                }
              ]
            },
            "description": "Returns redirect_url. Domains of the three URLs must be registered in your merchant profile."
          }
        },
        {
          "name": "Payment status",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/payment/status",
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "public_key",
                  "value": "{{test_public_key}}",
                  "type": "text"
                },
                {
                  "key": "identifier",
                  "value": "{{identifier}}",
                  "type": "text"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Payment links (live keys)",
      "item": [
        {
          "name": "Create link",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Public-Key",
                "value": "{{live_public_key}}"
              },
              {
                "key": "X-Secret-Key",
                "value": "{{live_secret_key}}"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/payment-links",
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "amount",
                  "value": "2500",
                  "type": "text"
                },
                {
                  "key": "note",
                  "value": "Order 1042",
                  "type": "text"
                },
                {
                  "key": "days",
                  "value": "3",
                  "type": "text"
                },
                {
                  "key": "reference",
                  "value": "{{reference}}",
                  "type": "text"
                },
                {
                  "key": "ipn_url",
                  "value": "https://yourshop.dz/ipn",
                  "type": "text"
                }
              ]
            }
          }
        },
        {
          "name": "Get link",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Public-Key",
                "value": "{{live_public_key}}"
              },
              {
                "key": "X-Secret-Key",
                "value": "{{live_secret_key}}"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/payment-links/{{reference}}"
          }
        },
        {
          "name": "Reactivate link",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Public-Key",
                "value": "{{live_public_key}}"
              },
              {
                "key": "X-Secret-Key",
                "value": "{{live_secret_key}}"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/payment-links/{{reference}}/reactivate"
          }
        }
      ]
    }
  ]
}