demo botbelanja

demo botbelanja · GPT-Aktionen

BotBelanja API

API for BotBelanja including product details retrieval and purchase order submission.

  • GET /custom_gpt_display_product_webhook.phpRetrieves product details
  • POST /custom_gpt_webhook.phpSubmit pembelian order
Ursprüngliches API-Schema
{
  "openapi": "3.0.0",
  "info": {
    "title": "BotBelanja API",
    "description": "API for BotBelanja including product details retrieval and purchase order submission.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://botbelanja.com/botbelanja_v2/botbelanja_demo",
      "description": "Main production server"
    }
  ],
  "paths": {
    "/custom_gpt_display_product_webhook.php": {
      "get": {
        "operationId": "getProductDetails",
        "summary": "Retrieves product details",
        "responses": {
          "200": {
            "description": "A JSON array of product details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "codeproduct": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      },
                      "productname": {
                        "type": "string"
                      },
                      "deskripsi": {
                        "type": "string"
                      },
                      "harga": {
                        "type": "string"
                      },
                      "is_active": {
                        "type": "string"
                      },
                      "url_images": {
                        "type": "string"
                      },
                      "url_video": {
                        "type": "string"
                      },
                      "url_pdf": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/custom_gpt_webhook.php": {
      "post": {
        "operationId": "submitOrder",
        "summary": "Submit pembelian order",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nama_pembeli": {
                    "type": "string"
                  },
                  "email_pembeli": {
                    "type": "string"
                  },
                  "wa_pembeli": {
                    "type": "string"
                  },
                  "alamat_kirim": {
                    "type": "string"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "codeproduct": {
                          "type": "string"
                        },
                        "sender": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "productname": {
                          "type": "string"
                        },
                        "cartid": {
                          "type": "string"
                        },
                        "cartdate": {
                          "type": "string"
                        },
                        "hargasatuan": {
                          "type": "number"
                        },
                        "qty": {
                          "type": "integer"
                        },
                        "totalharga": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data berhasil diproses",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "Data berhasil diproses"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Terjadi kesalahan atau JSON tidak valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 404
                    },
                    "message": {
                      "type": "string",
                      "example": "JSON tidak valid atau Terjadi kesalahan: [error message]"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}