{
  "openapi": "3.0.0",
  "info": {
    "title": "ApplePay API",
    "version": "2.3.0",
    "description": "REST 2.0 ApplePay API"
  },
  "servers": [
    {
      "url": "https://api-sandbox.nuvei.com/apple-pay-api",
      "description": "sandbox"
    },
    {
      "url": "https://api.nuvei.com/apple-pay-api",
      "description": "prod"
    }
  ],
  "tags": [
    {
      "name": "Apple Pay Session"
    },
    {
      "name": "Domains Operations"
    }
  ],
  "paths": {
    "/entities/{entity-id}/payment-sessions": {
      "get": {
        "tags": [
          "Apple Pay Session"
        ],
        "summary": "Request an Apple Pay Payment Session",
        "description": "Request an Apple Pay Payment Session",
        "operationId": "getPaymentSession",
        "parameters": [
          {
            "name": "entity-id",
            "in": "path",
            "description": "NCP Processing Entity ID",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "validation_url",
            "in": "query",
            "description": "Validation URL",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string",
              "format": "uri-reference",
              "example": "https://apple-pay-gateway.apple.com/paymentservices/startSession"
            }
          },
          {
            "name": "merchant_domain",
            "in": "query",
            "description": "Merchant specified domain",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string",
              "example": "https://example.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment Session Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentSessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          }
        },
        "security": [
          {
            "accessToken": []
          },
          {
            "apiKey": []
          }
        ]
      }
    },
    "/entities/{entity-id}/domains/register": {
      "post": {
        "tags": [
          "Domains Operations"
        ],
        "summary": "Registers a list of domains for the provided Entity with Apple Pay",
        "description": "Registers a list of domains for the provided Entity with Apple Pay",
        "operationId": "registerDomains",
        "parameters": [
          {
            "name": "entity-id",
            "in": "path",
            "description": "NCP Processing Entity ID",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantRegisterDomainsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                },
                "example": {
                  "result": {
                    "status": "success"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          }
        },
        "security": [
          {
            "accessToken": []
          },
          {
            "apiKey": []
          }
        ]
      }
    },
    "/entities/{entity-id}/domains/unregister": {
      "post": {
        "tags": [
          "Domains Operations"
        ],
        "summary": "Unregisters a list of domains for the provided Entity with Apple Pay",
        "description": "Unregisters a list of domains for the provided Entity with Apple Pay",
        "operationId": "unregisterDomains",
        "parameters": [
          {
            "name": "entity-id",
            "in": "path",
            "description": "NCP Processing Entity ID",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantUnregisterDomainsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                },
                "example": {
                  "result": {
                    "status": "success"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultWrapped"
                }
              }
            }
          }
        },
        "security": [
          {
            "accessToken": []
          },
          {
            "apiKey": []
          }
        ]
      }
    },
    "/entities/{entity-id}/domains": {
      "get": {
        "tags": [
          "Domains Operations"
        ],
        "summary": "Gets a list of registered domains for the provided Entity with Apple Pay",
        "description": "Gets a list of registered domains for the provided Entity with Apple Pay",
        "operationId": "getMerchantDomains",
        "parameters": [
          {
            "name": "entity-id",
            "in": "path",
            "description": "NCP Processing Entity ID",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantDetailsResponse"
                },
                "example": {
                  "partnerMerchantName": "ACME Anvils & Explosives",
                  "domainNames": [
                    "acme.com"
                  ],
                  "result": {
                    "status": "success"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantDetailsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantDetailsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantDetailsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantDetailsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantDetailsResponse"
                },
                "example": {
                  "resilt": {
                    "status": "error",
                    "errors": {
                      "code": "7000.1000",
                      "reason": "Internal system error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "accessToken": []
          },
          {
            "apiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiResultOutput": {
        "title": "ApiResultOutput",
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "maxLength": 50,
            "type": "string",
            "enum": [
              "error",
              "success"
            ]
          },
          "errors": {
            "$ref": "#/components/schemas/ResultError"
          }
        }
      },
      "ResultError": {
        "title": "ResultError",
        "required": [
          "code"
        ],
        "type": "object",
        "properties": {
          "code": {
            "maxLength": 11,
            "type": "string",
            "example": "7000.1000"
          },
          "reason": {
            "maxLength": 400,
            "type": "string",
            "example": "Internal Processing Error"
          },
          "reference": {
            "maxLength": 400,
            "type": "string",
            "description": "Internal reference for troubleshooting",
            "example": "110.1290"
          }
        }
      },
      "ApiResultWrapped": {
        "title": "ApiResultWrapped",
        "required": [
          "result"
        ],
        "type": "object",
        "properties": {
          "result": {
            "$ref": "#/components/schemas/ApiResultOutput"
          }
        }
      },
      "ApplePaySession": {
        "title": "ApplePaySessionResponse",
        "type": "object",
        "properties": {
          "epochTimestamp": {
            "type": "integer",
            "format": "int64",
            "example": 1689587571029
          },
          "expiresAt": {
            "type": "integer",
            "format": "int64",
            "example": 1689591171029
          },
          "merchantSessionIdentifier": {
            "type": "string",
            "example": "SSH2CABEF39E92A4920BD980350E1E30919_C23A0D3024FAB8B12CBB67660B4C1B48ABF1272EC8B61399E3A647290C8BE67A"
          },
          "nonce": {
            "type": "string",
            "example": "cec23c3f"
          },
          "merchantIdentifier": {
            "type": "string",
            "example": "4BAB8DF766AF09D6CBD35F5AA881488E338020360610942BE8A75DCE330A1568"
          },
          "domainName": {
            "type": "string",
            "example": "secure.nuvei.com"
          },
          "displayName": {
            "type": "string",
            "example": "ACMEStore"
          },
          "signature": {
            "type": "string",
            "example": "308006092a864886f70d010702a0803080020101310d300b0609608648016503040201308006092a864886f70d0107010000a080308203e330820388a00302010202084c304149519d5436300a06082a8648ce3d040302307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3139303531383031333235375a170d3234303531363031333235375a305f3125302306035504030c1c6563632d736d702d62726f6b65722d7369676e5f5543342d50524f4431143012060355040b0c0b694f532053797374656d7331133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004c21577edebd6c7b2218f68dd7090a1218dc7b0bd6f2c283d846095d94af4a5411b83420ed811f3407e83331f1c54c3f7eb3220d6bad5d4eff49289893e7c0f13a38202113082020d300c0603551d130101ff04023000301f0603551d2304183016801423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b304506082b0601050507010104393037303506082b060105050730018629687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65616963613330323082011d0603551d2004820114308201103082010c06092a864886f7636405013081fe3081c306082b060105050702023081b60c81b352656c69616e6365206f6e207468697320636572746966696361746520627920616e7920706172747920617373756d657320616363657074616e6365206f6620746865207468656e206170706c696361626c65207374616e64617264207465726d7320616e6420636f6e646974696f6e73206f66207573652c20636572746966696361746520706f6c69637920616e642063657274696669636174696f6e2070726163746963652073746174656d656e74732e303606082b06010505070201162a687474703a2f2f7777772e6170706c652e636f6d2f6365727469666963617465617574686f726974792f30340603551d1f042d302b3029a027a0258623687474703a2f2f63726c2e6170706c652e636f6d2f6170706c6561696361332e63726c301d0603551d0e041604149457db6fd57481868989762f7e578507e79b5824300e0603551d0f0101ff040403020780300f06092a864886f76364061d04020500300a06082a8648ce3d0403020349003046022100be09571fe71e1e735b55e5afacb4c72feb445f30185222c7251002b61ebd6f55022100d18b350a5dd6dd6eb1746035b11eb2ce87cfa3e6af6cbd8380890dc82cddaa63308202ee30820275a0030201020208496d2fbf3a98da97300a06082a8648ce3d0403023067311b301906035504030c124170706c6520526f6f74204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3134303530363233343633305a170d3239303530363233343633305a307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004f017118419d76485d51a5e25810776e880a2efde7bae4de08dfc4b93e13356d5665b35ae22d097760d224e7bba08fd7617ce88cb76bb6670bec8e82984ff5445a381f73081f4304606082b06010505070101043a3038303606082b06010505073001862a687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65726f6f7463616733301d0603551d0e0416041423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b300f0603551d130101ff040530030101ff301f0603551d23041830168014bbb0dea15833889aa48a99debebdebafdacb24ab30370603551d1f0430302e302ca02aa0288626687474703a2f2f63726c2e6170706c652e636f6d2f6170706c65726f6f74636167332e63726c300e0603551d0f0101ff0404030201063010060a2a864886f7636406020e04020500300a06082a8648ce3d040302036700306402303acf7283511699b186fb35c356ca62bff417edd90f754da28ebef19c815e42b789f898f79b599f98d5410d8f9de9c2fe0230322dd54421b0a305776c5df3383b9067fd177c2c216d964fc6726982126f54f87a7d1b99cb9b0989216106990f09921d00003182018830820184020101308186307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b300906035504061302555302084c304149519d5436300b0609608648016503040201a08193301806092a864886f70d010903310b06092a864886f70d010701301c06092a864886f70d010905310f170d3233303731373039353235315a302806092a864886f70d010934311b3019300b0609608648016503040201a10a06082a8648ce3d040302302f06092a864886f70d010904312204209f5716ad5b2ccc9751d1872b65174b29eb16c2d41a13b54499ed7fa02682356c300a06082a8648ce3d0403020447304502210097b0546914e30fd3c6d62bae05b375e9a67f8ee654d9d70013a7e7371ddbbbb80220036da0c19a419ef5d18973f08919bfea030f1938226715bf0bae5a8b2b4c3a77000000000000"
          },
          "operationalAnalyticsIdentifier": {
            "type": "string",
            "example": "ACMEStore:4BAB8DF766AF09D6CBD35F5AA881488E338020360610942BE8A75DCE330A1568"
          },
          "retries": {
            "type": "integer",
            "example": 0
          },
          "pspId": {
            "type": "string",
            "example": "12E29215661EC6D9AEE7B6FC802B330EE7DF0B317DFCEDBB6E6DAEAED6C10580"
          }
        },
        "description": "ApplePaySessionResponse"
      },
      "PaymentSessionResponse": {
        "title": "PaymentSessionResponse",
        "allOf": [
          {
            "type": "object",
            "properties": {
              "applePaySession": {
                "$ref": "#/components/schemas/ApplePaySession"
              }
            }
          },
          {
            "required": [
              "result"
            ],
            "type": "object",
            "properties": {
              "result": {
                "$ref": "#/components/schemas/ApiResultOutput"
              }
            }
          }
        ]
      },
      "Domain": {
        "title": "Domain Name",
        "maxLength": 2000,
        "type": "string"
      },
      "DomainNames": {
        "title": "Domain Names",
        "maxItems": 99,
        "minItems": 1,
        "uniqueItems": true,
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Domain"
        }
      },
      "PartnerMerchantName": {
        "title": "Partner Merchant Name",
        "maxLength": 1024,
        "type": "string"
      },
      "Reason": {
        "title": "Apple Pay Merchant Unregister Reason",
        "maxLength": 1024,
        "type": "string"
      },
      "MerchantDetailsResponse": {
        "title": "Merchant Details",
        "required": [
          "result"
        ],
        "type": "object",
        "properties": {
          "partnerMerchantName": {
            "$ref": "#/components/schemas/PartnerMerchantName"
          },
          "domainNames": {
            "$ref": "#/components/schemas/DomainNames"
          },
          "merchantUrl": {
            "$ref": "#/components/schemas/Domain"
          },
          "result": {
            "$ref": "#/components/schemas/ApiResultOutput"
          }
        }
      },
      "MerchantUnregisterDomainsRequest": {
        "title": "Merchant Unregister Domains Request",
        "required": [
          "domainNames",
          "reason"
        ],
        "type": "object",
        "properties": {
          "domainNames": {
            "$ref": "#/components/schemas/DomainNames"
          },
          "reason": {
            "$ref": "#/components/schemas/Reason"
          }
        }
      },
      "MerchantRegisterDomainsRequest": {
        "title": "Merchant Register Domains Request",
        "required": [
          "domainNames"
        ],
        "type": "object",
        "properties": {
          "partnerMerchantName": {
            "$ref": "#/components/schemas/PartnerMerchantName"
          },
          "domainNames": {
            "$ref": "#/components/schemas/DomainNames"
          },
          "merchantUrl": {
            "$ref": "#/components/schemas/Domain"
          }
        }
      }
    },
    "parameters": {
      "entity-id": {
        "name": "entity-id",
        "in": "path",
        "description": "NCP Processing Entity ID",
        "required": true,
        "style": "simple",
        "explode": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "type": {
        "name": "type",
        "in": "query",
        "description": "Certificate type",
        "required": false,
        "style": "form",
        "explode": true,
        "example": "IDENTITY"
      },
      "integration": {
        "name": "integration",
        "in": "query",
        "description": "Integration type",
        "required": false,
        "style": "form",
        "explode": true,
        "example": "API"
      },
      "certificate-id": {
        "name": "certificate-id",
        "in": "path",
        "description": "Certificate Id",
        "required": true,
        "style": "simple",
        "explode": false,
        "schema": {
          "type": "string"
        }
      },
      "validation_url": {
        "name": "validation_url",
        "in": "query",
        "description": "Validation URL",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "string",
          "format": "uri-reference",
          "example": "https://apple-pay-gateway.apple.com/paymentservices/startSession"
        }
      },
      "merchant_domain": {
        "name": "merchant_domain",
        "in": "query",
        "description": "Merchant specified domain",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "string",
          "example": "https://example.com"
        }
      }
    },
    "securitySchemes": {
      "accessToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apiKey": {
        "type": "apiKey",
        "name": "X-API-KEY",
        "in": "header"
      }
    }
  }
}