{
  "info": {
    "name": "DzWallet Payment API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "SATIM card payments in DZD. Test checkout uses TEST keys and never contacts a real gateway. Keep secret keys in your private Postman environment. A payment API response can use HTTP 200 for success or error. Inspect the JSON status."
  },
  "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": "Use a unique order identifier of at most 20 characters. All callback and redirect domains must be registered in your merchant profile. Redirect the customer only if JSON status is success and redirect_url is present. If the request times out, check payment status before trying again."
          }
        },
        {
          "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": "Use a unique order identifier of at most 20 characters. All callback and redirect domains must be registered in your merchant profile. Redirect the customer only if JSON status is success and redirect_url is present. If the request times out, check payment status before trying again."
          }
        },
        {
          "name": "Payment status (TEST)",
          "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"
                }
              ]
            },
            "description": "Use the same test key and identifier as the original payment. Treat the order as paid only when JSON status and payment_status are both success."
          }
        },
        {
          "name": "Payment status (LIVE)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/payment/status",
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "public_key",
                  "value": "{{live_public_key}}",
                  "type": "text"
                },
                {
                  "key": "identifier",
                  "value": "{{identifier}}",
                  "type": "text"
                }
              ]
            },
            "description": "Use the same live key and identifier as the original payment. Treat the order as paid only when JSON status and payment_status are both success."
          }
        }
      ]
    },
    {
      "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"
          }
        }
      ]
    }
  ]
}
