{
  "info": {
    "_postman_id": "9d9fb717-7325-5b61-a131-4f26309f0919",
    "name": "POS GROVE Domain & wallet API",
    "description": "Search, register, renew and manage domain names from your own software. Every purchase is paid from your POS GROVE wallet (USD).\n\n**Setup**\n1. Create an API key under Account → Developer API on posgrove.com.\n2. Paste it (`pgk_…`) into the collection variable `apiKey`.\n3. Start with **Domains → Search for a domain**, then **Register and pay from the wallet**.\n\nErrors: 401 UNAUTHORIZED, 402 INSUFFICIENT_FUNDS (details.shortBy), 403 API_KEY_NOT_ALLOWED, 404 NOT_FOUND, 409 DOMAIN_NOT_AVAILABLE / QUOTE_EXPIRED, 422 VALIDATION_ERROR, 423 WALLET_FROZEN, 429 RATE_LIMITED.\nLimits: search 20/minute per IP; wallet payments 60 per 15 minutes; up to 5 years per registration or renewal.\n\nReference: https://posgrove.com/docs/domains",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// POS GROVE APIs answer { success, message, data } (or { success: false, error, message }).",
          "pm.test(\"Response is JSON\", function () { pm.response.to.be.json; });",
          "pm.test(\"Envelope has a success flag\", function () {",
          "  var b = pm.response.json();",
          "  pm.expect(b).to.have.property(\"success\");",
          "  if (pm.response.code < 400) pm.expect(b.success).to.eql(true);",
          "});"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://update.posgrove.com/api/v1",
      "type": "string",
      "description": "POS GROVE ADMIN API address."
    },
    {
      "key": "apiKey",
      "value": "",
      "type": "string",
      "description": "Developer API key (pgk_…) from Account → Developer API."
    }
  ],
  "item": [
    {
      "name": "Wallet",
      "item": [
        {
          "name": "Wallet balance and activity",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/me/wallet",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "me",
                "wallet"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "20",
                  "description": "1–100",
                  "disabled": true
                }
              ]
            },
            "description": "Balance and the latest activity.\n\n`GET /users/me/wallet`"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Domains",
      "item": [
        {
          "name": "Extensions on sale and prices",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/tlds",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                "tlds"
              ]
            },
            "description": "Extensions on sale and their yearly prices. No key needed. First-year promotions can make registration cheaper than renewal.\n\n`GET /domains/tlds`",
            "auth": {
              "type": "noauth"
            }
          },
          "response": []
        },
        {
          "name": "Search for a domain",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/search?query=mybakery&years=1",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                "search"
              ],
              "query": [
                {
                  "key": "query",
                  "value": "mybakery",
                  "description": "A name (checked on popular extensions) or a full domain (mybakery.ng)"
                },
                {
                  "key": "years",
                  "value": "1",
                  "description": "1–5"
                }
              ]
            },
            "description": "reason when not purchasable: TAKEN, PREMIUM, PRICE_UNAVAILABLE.\n\n`GET /domains/search`"
          },
          "response": []
        },
        {
          "name": "Register and pay from the wallet",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                "orders"
              ]
            },
            "description": "Orders, pays and registers in one call. Without payWith an unpaid order (a price quote valid 60 minutes) is created.\n\n`POST /domains/orders`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"domain\": \"mybakery.com\",\n  \"years\": 1,\n  \"payWith\": \"wallet\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Pay an unpaid order from the wallet",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/orders/:orderId/pay",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                "orders",
                ":orderId",
                "pay"
              ],
              "variable": [
                {
                  "key": "orderId",
                  "value": "",
                  "description": "Order id from POST or GET /domains/orders"
                }
              ]
            },
            "description": "Fails with 409 QUOTE_EXPIRED once the quote is older than 60 minutes.\n\n`POST /domains/orders/:orderId/pay`"
          },
          "response": []
        },
        {
          "name": "List your domains",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains"
              ]
            },
            "description": "`GET /domains`"
          },
          "response": []
        },
        {
          "name": "Get a domain (with DNS records)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                }
              ]
            },
            "description": "`GET /domains/:domainId`"
          },
          "response": []
        },
        {
          "name": "Renew a domain",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/renew",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "renew"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                }
              ]
            },
            "description": "Adds the years to the current expiry date. Without payWith you get an unpaid renewal order.\n\n`POST /domains/:domainId/renew`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"years\": 1,\n  \"payWith\": \"wallet\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Turn auto-renew on or off",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/auto-renew",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "auto-renew"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                }
              ]
            },
            "description": "Renews for 1 year from the wallet up to 30 days before expiry.\n\n`PATCH /domains/:domainId/auto-renew`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "DNS records",
      "description": "Types: A, AAAA, CNAME, ALIAS, MX, TXT, NS, SRV, CAA. name is the part before the domain (@ for the domain itself); prio for MX and SRV. Records only take effect while the domain uses our nameservers.",
      "item": [
        {
          "name": "List DNS records",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/dns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "dns"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                }
              ]
            },
            "description": "`GET /domains/:domainId/dns`"
          },
          "response": []
        },
        {
          "name": "Add a DNS record",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/dns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "dns"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                }
              ]
            },
            "description": "`POST /domains/:domainId/dns`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"A\",\n  \"name\": \"@\",\n  \"content\": \"203.0.113.10\",\n  \"ttl\": 600\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Change a DNS record",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/dns/:recordId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "dns",
                ":recordId"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                },
                {
                  "key": "recordId",
                  "value": "",
                  "description": "Record id from GET /domains/:domainId/dns"
                }
              ]
            },
            "description": "`PUT /domains/:domainId/dns/:recordId`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"CNAME\",\n  \"name\": \"www\",\n  \"content\": \"mybakery.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a DNS record",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/dns/:recordId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "dns",
                ":recordId"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                },
                {
                  "key": "recordId",
                  "value": "",
                  "description": "Record id from GET /domains/:domainId/dns"
                }
              ]
            },
            "description": "`DELETE /domains/:domainId/dns/:recordId`"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Nameservers",
      "description": "Changes can take up to 48 hours to spread across the internet.",
      "item": [
        {
          "name": "Get nameservers",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/nameservers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "nameservers"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                }
              ]
            },
            "description": "`GET /domains/:domainId/nameservers`"
          },
          "response": []
        },
        {
          "name": "Use your own nameservers",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/nameservers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "nameservers"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                }
              ]
            },
            "description": "`PUT /domains/:domainId/nameservers`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nameservers\": [\n    \"ns1.host.com\",\n    \"ns2.host.com\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Go back to the POS GROVE nameservers",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/:domainId/nameservers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                ":domainId",
                "nameservers"
              ],
              "variable": [
                {
                  "key": "domainId",
                  "value": "",
                  "description": "Domain id from GET /domains"
                }
              ]
            },
            "description": "`PUT /domains/:domainId/nameservers`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"useDefault\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Orders",
      "item": [
        {
          "name": "List orders",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                "orders"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "pending_payment",
                  "description": "pending_payment | completed | failed | cancelled",
                  "disabled": true
                }
              ]
            },
            "description": "Registration and renewal orders, newest first.\n\n`GET /domains/orders`"
          },
          "response": []
        },
        {
          "name": "Get an order",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/orders/:orderId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                "orders",
                ":orderId"
              ],
              "variable": [
                {
                  "key": "orderId",
                  "value": "",
                  "description": "Order id from POST or GET /domains/orders"
                }
              ]
            },
            "description": "`GET /domains/orders/:orderId`"
          },
          "response": []
        },
        {
          "name": "Cancel an unpaid order",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/domains/orders/:orderId/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "domains",
                "orders",
                ":orderId",
                "cancel"
              ],
              "variable": [
                {
                  "key": "orderId",
                  "value": "",
                  "description": "Order id from POST or GET /domains/orders"
                }
              ]
            },
            "description": "`POST /domains/orders/:orderId/cancel`"
          },
          "response": []
        }
      ]
    }
  ]
}