---
agentTools:
  projectIndex: https://zafepay.readme.io/llms.txt
---

# Update single payment

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Onlypays",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.staging.zafepay.com/api"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/integration/single_payments/{single_payment_id}": {
      "put": {
        "summary": "Update single payment",
        "description": "",
        "operationId": "update-single-payment",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Header to access api endpoints (Check the authentication section).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "single_payment": {
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name of the Single Payment you want to create."
                      },
                      "description": {
                        "type": "string",
                        "description": "A description for the Single Payment."
                      },
                      "stock_limit": {
                        "type": "integer",
                        "description": "If the Single Payment is single you can define a stock limit for purchases.",
                        "format": "int32"
                      },
                      "limit_date": {
                        "type": "string",
                        "description": "If the Single Payment is single you can define a date for stop accepting purchases for the Product (in ISO 8601 format).",
                        "format": "date"
                      },
                      "status": {
                        "type": "string",
                        "description": "The status of the Single Payment. It can be \"active\" (default) or \"inactive\". If you change the status to inactive, all registrations for this Single Payment will be canceled and unpaid installments will not be charged (the pending and expired installments of the single_payment_buyers).",
                        "enum": [
                          "active",
                          "inactive"
                        ]
                      },
                      "is_basketable": {
                        "type": "boolean",
                        "description": "If you want your customers to be able to buy more than one Single Payment at the same time (default false)."
                      },
                      "success_url": {
                        "type": "string",
                        "description": "A URL to redirect your clients when the payment of the Single Payment is successful."
                      },
                      "failure_url": {
                        "type": "string",
                        "description": "A URL to redirect your clients when the payment of the Single Payment fails."
                      },
                      "image": {
                        "type": "string",
                        "description": "An image for the Single Payment.",
                        "format": "binary"
                      },
                      "external_id": {
                        "type": "string",
                        "description": "An external id to identify the Single Payment."
                      },
                      "extra_fields": {
                        "type": "array",
                        "description": "Extra fields that your customers can fill out when buying or subscribing to the Single Payment (Independent of these extra fields, the email and the name are always requested). The json has scpecific values: - question (string): The name of the extra field. - mandatory (boolean): If the extra field is mandatory to answer (default false).",
                        "items": {
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The id of the extra field that you want to edit, if applicable."
                            },
                            "name": {
                              "type": "string",
                              "description": "The name of the extra field you wan to ask for your customer."
                            },
                            "mandatory": {
                              "type": "boolean",
                              "description": "If the extra field is mandatory to answer (default false)."
                            },
                            "remove_extra_field": {
                              "type": "boolean",
                              "description": "If you want to remove the extra field from the Subscription"
                            }
                          },
                          "type": "object"
                        }
                      }
                    },
                    "required": [],
                    "type": "object",
                    "description": "Envelops the message content."
                  },
                  "products": {
                    "type": "array",
                    "description": "The products you want to offer in this Single Payment. A Single Payement cannot be left without an associated Product.",
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The id of the product you want to add to the Single Payment, if applicable."
                        },
                        "quantity": {
                          "type": "integer",
                          "description": "The quantity of the product you want to add to the Single Payment.",
                          "format": "int32"
                        },
                        "remove_single_payment_product": {
                          "type": "boolean",
                          "description": "If you want to remove the product from the Single Payment set this value to true."
                        }
                      },
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"data\": {\n        \"id\": \"5d58d855-09ee-4087-bba3-3a000d36c1ea\",\n        \"created_at\": \"2023-10-10T23:55:00\",\n        \"external_id\": \"sp002\",\n        \"extra_fields\": [\n            {\n                \"id\": \"8d4fbc75-f3fe-4e09-b985-040a0ac15d91\",\n                \"mandatory\": true,\n                \"question\": \"Age\"\n            }\n        ],\n        \"inscription_link\": \"http://localhost:8080/single_payments/5d58d855-09ee-4087-bba3-3a000d36c1ea\",\n        \"is_basketable\": null,\n        \"limit_date\": \"2023-12-31T23:59:59\",\n        \"name\": \"SummerFest pack\",\n        \"single_payment_products\": [\n            {\n                \"id\": \"e65ca08f-0082-4673-9ecc-983f97027d19\",\n                \"created_at\": \"2023-10-10T23:55:00\",\n                \"product\": {\n                    \"id\": \"3ee60f6f-d706-4ceb-a4ae-1efae73ec55e\",\n                    \"created_at\": \"2023-10-10T23:13:23\",\n                    \"currency\": \"CLP\",\n                    \"description\": null,\n                    \"external_id\": \"004\",\n                    \"image\": null,\n                    \"name\": \"SummerFest ticket\",\n                    \"status\": \"active\",\n                    \"updated_at\": \"2023-10-10T23:13:23\",\n                    \"value\": 39990\n                },\n                \"quantity\": 1,\n                \"updated_at\": \"2023-10-11T00:52:00\",\n                \"value\": 39990\n            },\n            {\n                \"id\": \"6c55f720-5684-4ffc-9191-b99552240b12\",\n                \"created_at\": \"2023-10-11T00:52:27\",\n                \"product\": {\n                    \"id\": \"3efb3aac-ad3c-45aa-ba27-4e9c5e794681\",\n                    \"created_at\": \"2023-10-10T23:13:40\",\n                    \"currency\": \"CLP\",\n                    \"description\": null,\n                    \"external_id\": \"005\",\n                    \"image\": null,\n                    \"name\": \"SummerFest t-shirt\",\n                    \"status\": \"active\",\n                    \"updated_at\": \"2023-10-10T23:13:40\",\n                    \"value\": 19990\n                },\n                \"quantity\": 2,\n                \"updated_at\": \"2023-10-11T00:52:27\",\n                \"value\": 39980\n            }\n        ],\n        \"status\": \"active\",\n        \"stock_limit\": null,\n        \"updated_at\": \"2023-10-11T00:56:04\",\n        \"value\": 79970\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "5d58d855-09ee-4087-bba3-3a000d36c1ea"
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2023-10-10T23:55:00"
                        },
                        "external_id": {
                          "type": "string",
                          "example": "sp002"
                        },
                        "extra_fields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "8d4fbc75-f3fe-4e09-b985-040a0ac15d91"
                              },
                              "mandatory": {
                                "type": "boolean",
                                "example": true,
                                "default": true
                              },
                              "question": {
                                "type": "string",
                                "example": "Age"
                              }
                            }
                          }
                        },
                        "inscription_link": {
                          "type": "string",
                          "example": "http://localhost:8080/single_payments/5d58d855-09ee-4087-bba3-3a000d36c1ea"
                        },
                        "is_basketable": {},
                        "limit_date": {
                          "type": "string",
                          "example": "2023-12-31T23:59:59"
                        },
                        "name": {
                          "type": "string",
                          "example": "SummerFest pack"
                        },
                        "single_payment_products": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "e65ca08f-0082-4673-9ecc-983f97027d19"
                              },
                              "created_at": {
                                "type": "string",
                                "example": "2023-10-10T23:55:00"
                              },
                              "product": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "example": "3ee60f6f-d706-4ceb-a4ae-1efae73ec55e"
                                  },
                                  "created_at": {
                                    "type": "string",
                                    "example": "2023-10-10T23:13:23"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "example": "CLP"
                                  },
                                  "description": {},
                                  "external_id": {
                                    "type": "string",
                                    "example": "004"
                                  },
                                  "image": {},
                                  "name": {
                                    "type": "string",
                                    "example": "SummerFest ticket"
                                  },
                                  "status": {
                                    "type": "string",
                                    "example": "active"
                                  },
                                  "updated_at": {
                                    "type": "string",
                                    "example": "2023-10-10T23:13:23"
                                  },
                                  "value": {
                                    "type": "integer",
                                    "example": 39990,
                                    "default": 0
                                  }
                                }
                              },
                              "quantity": {
                                "type": "integer",
                                "example": 1,
                                "default": 0
                              },
                              "updated_at": {
                                "type": "string",
                                "example": "2023-10-11T00:52:00"
                              },
                              "value": {
                                "type": "integer",
                                "example": 39990,
                                "default": 0
                              }
                            }
                          }
                        },
                        "status": {
                          "type": "string",
                          "example": "active"
                        },
                        "stock_limit": {},
                        "updated_at": {
                          "type": "string",
                          "example": "2023-10-11T00:56:04"
                        },
                        "value": {
                          "type": "integer",
                          "example": 79970,
                          "default": 0
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": []
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "64c97d0ad3b2f2002d150a5d:64e936500046bb000dd8d47b"
}
```